notes and other stuff

 
« Back to blog

Useless HTML Forms

I wish html forms could do more, they are just so static, and more less useless on a dynamic website.

Like imaging if you could do something like this :



<form action="/api/rest/createUser" onsubmit="jsonRequest(this.requestUrl)">


  <input type="submit" value="do magic"/>


  <select name="video">


    <option value="1">Video 1</option> 


    <option value="2">Video 2</option>


  </select>


</form> 


Where jsonRequest would do a asyc request, and the requestUrl would have the value of the action and all the parameters.

eg. if Video 1 was selected, the requestUrl would have the value on submit of :



/api/rest/createUser?video=1


That would make forms a bit more useful. Perhaps I should take a look at HTML5 and see if help is coming.

Comments (0)

Leave a comment...

 
To leave a comment on this posterous, please login by clicking one of the following.
Posterous-login     Connect     twitter