Question

Possible Duplicate:
Is it a good practice to use an empty URL for a HTML form's action attribute? (action=“”)

I'm updating a project to include an Ajax Updater (http://ajaxuploader.com) and couldn't figure out why it wasn't working on my page but worked in my simple example. So I started pulling stuff off the page and found out it was the Action="#" in my form tag.

Unfortunately removing this removes other functionality (think it calls some existing Ajax but not quite sure). What I'm asking is: what is Action="#" and are there any alternatives I could try?

Was it helpful?

Solution

Action="#" is basically the html equivalent of Post to self. # is technically an anchor so if you click on a link that is just "#" it does nothing.

Browser should interpret any Action="#" as Action="THE_HOSTNAME/PAGE"

Its designed to get around W3C Validation a times since Action="" is considered invalid, since all attributes must have values, this ensures a value is available for the attribute.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top