Forum Moderators: open

Message Too Old, No Replies

xhtml compliant ajax form

         

tekomp

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

10+ Year Member



Hi,

I have a form which uses ajax to POST to a script, but I'm not sure what to use for my "action" form attribute. This is how the form is layed out now:


<form>
...
<input type="button" value="submit" onclick="process()" />
</form>

Since the form is processing with the onclick event, I don't know what to put for <form action="?">, and this attribute is required for xhtml compliance. Any ideas?

Thanks.

DrDoc

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

WebmasterWorld Senior Member 10+ Year Member



Point the action attribute to the script you use as a fallback for those who have JavaScript disabled.

If you have no such fallback, you should either:
1) strongly consider adding a fallback
2) make sure that the entire form is added to the page using JavaScript, with noscript tags with explanation for those with JavaScript disabled