Auto-Form Maker: Create a Querystring based on ANY FORM!

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

Mp)Tarh

Established Member
Impact
1
I attached the .txt file that contains the JavaScript code.

It is open source, so edit it as you will - just leave the message at the top.

This code contains a very flexable function named "compilestring()".

The function takes 2 parameters.

The first parameter is a string that contains the page for the user to see next (Example: home.htm).

The second parameter is optional. It is a string that contains the name of a form. If it is provided, the querystring will only be built around the information in that form.

If the second parameter is not provided, the querystring is based on every form in the page.

An example of the function is the following:

alert(compilestring("home.htm","my_form"))

If the form named "my_form" contained the following data:

<FORM NAME="my_form">
<INPUT TYPE="text" NAME="box1" VALUE="hello world!">
<INPUT TYPE="text" NAME="sun" VALUE="hot">
</FORM>


then the above code would make an alert box that states:

home.asp?createdby=formmaker&box1=hello%20world%21&sun=hot

Notice that the querystring is automatically escaped.

Happy programming!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Personally, feel free to delete what's on top. Javascript is always open source. No one can legally sue you or make any penalty for you not putting their name at the top of a javascript. On the other hand, stealing someone's java, stealing someone's flash, or stealing someone's entire layout, that's illegal.
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back