Domain Empire

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

Spaceship Spaceship
Watch
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
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
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back