Beluga
28 Oct 2010, 03:40 PM
I'm using jQuery Tools ajaxed tabs (http://flowplayer.org/tools/demos/tabs/ajax-history.html) and trying to get form submitting to work inside a page fetched with ajax. I figured I would try the .live-functionality in jQuery, but no effect. .live working with form submits across all browsers is a pretty new thing, final bugs fixed in jQuery 1.4.3.
Here's my code that just doesn't do anything:
<script type="text/javascript">
jQuery(function( $ ){
$( "form" ).live(
"submit",
function( event ){
var datas = {
env_report: 'REMOTE_HOST,HTTP_USER_AGENT'
recipient: 'mymail@somehost.com',
name: Name
};
$.ajax({
type: "POST",
url: "cgi-bin/FormMail.pl",
data: datas
});
return false;
});
});
</script>
Don't worry about the perl script, I know it's not secure and will switch to something better..
Edit: Problem sorted.. a pop up image I had assigned to the submit button was messing things up.
Here's my code that just doesn't do anything:
<script type="text/javascript">
jQuery(function( $ ){
$( "form" ).live(
"submit",
function( event ){
var datas = {
env_report: 'REMOTE_HOST,HTTP_USER_AGENT'
recipient: 'mymail@somehost.com',
name: Name
};
$.ajax({
type: "POST",
url: "cgi-bin/FormMail.pl",
data: datas
});
return false;
});
});
</script>
Don't worry about the perl script, I know it's not secure and will switch to something better..
Edit: Problem sorted.. a pop up image I had assigned to the submit button was messing things up.