Forum Moderators: open

Message Too Old, No Replies

ajax forms but javascript disabled

         

tekomp

12:21 am on Apr 8, 2006 (gmt 0)

10+ Year Member



I'd like to create an ajax form, but still have it work for people that have javascript disabled. Is there a way to do this with one form, or do I have to display a separate form after I determine if the user has js disabled?

Thanks.

DrDoc

4:10 am on Apr 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can do it all using the same form.

Use an onsubmit (or onclick) handler on the submit button to trigger the JavaScript behavior (make sure your function returns false to abort normal form submit). Then, simply make sure that you have specified the appropriate action attribute for those with JavaScript disabled.

Also, make sure that you use submit buttons in your form.

designaweb

6:11 am on Apr 8, 2006 (gmt 0)

10+ Year Member



Unless the first form itself has selectboxes for example filled by active scripting :) Then it wont work...