FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

help with unobtrusive ajax

 


ammonkc
I need to submit a form via ajax with prototype.js unobtrusively. How do I unobtrusively attach the script to submit with prototype? I've done it with jQuery before, but I need to use prototype on this one. Basically I need to do with prototype.js what the below script does with jquery.js. I would appreciate any help.
Code:

$(function() { // onload...do
  $('#contestForm').submit(function() {
    var inputs = [];
    $(':input', this).each(function() {
      inputs.push(this.name + '=' + escape(this.value));
    })
    jQuery.ajax({
      data: inputs.join('&'),
      url: this.action + '?type=ajax',
      timeout: 2000,
      error: function() {
        console.log("Failed to submit");
      },
      success: function(r) {
        jQuery.facebox(r);
      }
    })
    return false;
  })
})
Related topics

Ajax or JS - need help ASAP
Super fast script mod (300 frih)
Help making an AJAX messaging system
AJAX based 5 star rating script
AJAX tutorial [2nd part now updated]

Need Ajax Help
Some useful DHTML/AJAX scripts
Need Help AJAX using WYSWYG Script.
ajax help
Do you know this Ajax Effect

AJAX tutorials?
Javascript help
Ajax Stack Overflow IE
AJAX coding prob
jQuery and Ajax problem
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.