What does FIrebug say you are actually sending? What does it say your
server is returning back to you? That''s where I would start.
Also, try the $F(''username'') shortcut, which taps into the
getValue
[1] method, rather than just $(''username'').value.
Walter
1. http://prototypejs.org/api/form/element/getValue
On Oct 19, 2007, at 5:49 PM, De La Groove wrote:
>
> hi, i''m having problems with a code i''m using, the idea
is when you
> submit the form, check some validations and if the validations are
> good do a request to see if the username is not taken, if this test
> pass, send the data.
>
> this is the code of the onsubmit, i check the console and there''s
no
> error, when i press submit it''s not sending anything, but the
> validation takes place and if you put a taken username he gets that.
> so when it''s ready to send it''s not doing it please help
>
> onSubmit=\"if($(''username'').value ==
''''){
> $(''errormsg'').innerHTML = ''please put a valid
username'';
> return false;
> }
> else if($(''password'').value == ''''){
> $(''errormsg'').innerHTML = ''please put a
password'';
> return false;
> }
>
> else{
> new Ajax.Request(''checkuser.php'', {
> method: ''get'', parameters:
''user=''+$(''username'').value,
> onSuccess: function(transport) {
> if(transport.responseText == 0){
> $(''errormsg'').innerHTML = '''';
> new Ajax.Updater(''rsvpform'',
''setrsvp2.php'',
>
{method:''post'',asynchronous:true,parameters:Form.serialize(this)});
> return false;
> }
> else{
> $(''errormsg'').innerHTML = ''Sorry, that
username is already
> taken.'';
> return false;
> }}});return false;}\"
>
> thanks
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---