Yep I have spotted that .val() is the way to go.  Although I can't seem to stop the form from submitting and displaying an error message.

I have found an example:
http://markc.renta.net/jquery/jquery_form_test.html

which shows how to use a callback

however that example is using
$('#test5-form').form('#test5-target', pre_callback)

where as I am using

$("form#contactFrm").submit(function() {
// function(target, post_cb, pre_cb, url, mth)
$(this).ajaxSubmit('div#contactFrmResult', postContact, null, 'ajax/contact_sub.php', 'post');
return false;
});

I am using the above as I wish to alter the url that data is sent to.
When _javascript_ is not used to submit the form I want data to be sent contact_sub.php
if _javascript_ is used then the data is sent to ajax/contact_sub.php

If the form is being hijax'd then should the it should shurely be submitted only if the precallback
returns true??

thats how I expected it to go.

I noticed that the example url (see above) has a confirm box pre submit.

I am returning false if any inputs don't meet my critiera (valid email and non empty values for name and comments)


thx
Sam

On 10/21/06, Mike Alsup <[EMAIL PROTECTED]> wrote:
> Is there an example of the correct implentation of preCallback with the
> forms plugin??

Sam,

If the form is getting submitted in a non-ajax fashion it is likely
due to a _javascript_ error.  If you're running Firebug, try stepping
through your callback to see where the error occurs.  One thing that
looks suspicious is your use of ".value" on the jQuery object.  I
think you want ".val()" there instead.

You can see an example of the callbacks in action here:

http://malsup.com/jquery/form

Mike

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to