How do I send text from a textbox from the web page to the server?
I can but if the text has a & or = in it the server does not get the full value.
Example:
the textbox has a name of "name" and the value in the text box is "notme&myname=justme"
When submitted the string is:
name=notme&myname=justme
This looks like two key/value pairs to the server so the name value becomes notme instead of the entire text box value. How can I send the entire value entered? Is there a way to put the value in quotes or something?
<form id="id-form" action="id.cgi" method="post" target="id-response">
<div class="text-input">
<label for="name">Name:</label>
<input type="text" id="name" name="name" maxlength="60">
</div>
<div class="text-input">
<label for="id-num">ID#:</label>
<input type="text" id="id-num" name="id-num" maxlength="60">
</div>
<div class="form-button">
<button name="save-id" id="save-id" class="save-button" type="submit">Save</button>
</div>
</form>
Guys,
When I do as you say the value is "notme" not "notme&myname=justme" because when the string is parsed the & character separates the key/value pairs. In the example the & and = should be part of the value, not a different key/value. That's the problem!
Using the example HTML above:
If I enter in the Name box noname&myname=justme
And in the ID# box 12345
The page sends:
name=notme&myname=justme&id-num=12345
When the server parses the string it gets 3 key/value pairs
name=notme
myname=justme
id-num=12345
What I want is 2 key/value pairs somehow
name=notme&myname=justme
id-num=12345
The problem is not the server side, its the way its sent from the web page.
OK, I must have been going nuts. The string from the page was fine, the & and = were encoded. The server side was decoding and saving the values properly. The problem was the server, when sending OUT the values to the page was not encoding them, and even if it were, the page was not set up to decode the values. THAT was were my problem was.
Thanks for the answers though!