Hello, i got this code:
which i use to process a form, now my questions is:Code:$(function() { // These first three lines of code compensate for Javascript being turned on and off. // It simply changes the submit input field from a type of "submit" to a type of "button". var paraTag = $('input#submit').parent('p'); $(paraTag).children('input').remove(); $(paraTag).append('<input type="button" name="submit" id="submit" value="Email Us Now!" />'); $('#main input#submit').click(function() { $('#main').append('<img src="images/ajax-loader.gif" class="loaderIcon" alt="Loading..." />'); var name = $('input#name').val(); var email = $('input#email').val(); var comments = $('textarea#comments').val(); var phone = $('input#phone').val(); $.ajax({ type: 'post', url: 'mail/contact.php', data: 'name=' + name + '&email=' + email + '&comments=' + comments + '&phone=' + phone , } }); // end ajax }); });
how can i perhaps give a form an ID and give it a different url on the $.ajax variable according to the form id???



Reply With Quote

Bookmarks