Submitting Forms with No Action
By trent on 05 Dec in Programming
Not sure if many people have discovered that you can actually submit forms with a blank action attribute. What this will do is submit to the same page(url variables and all). This is very useful if you’re a copy paste coder or need the flexibility of renaming files and not screwing up the action attribute. It appears to work great with Firefox, IE6-7, Safari, and Opera. W3 does state that the action attribute is required, but does not say the attribute can’t be blank(W3 on Forms). My html has also been passing validation testing so I take that as fair game! For those unclear here is what I mean:
<form action="" method="post">
<button type="submit" name="submitbtn"
So see, sometimes slackness can actually help out!