Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a string to a form field onsubmit

Status
Not open for further replies.

gringorick

Technical User
Joined
Apr 11, 2006
Messages
2
Location
US
Hi all, what is the simplest way to add a string of text onto the beginning of a submitted form value when it is submitted?

For example if the text input name="text1" and a user entered "hello world" into the text box, I would like the value changed to "Text #1 = hello world" onsubmit, and so on for text2, text3, etc.

Thanks for any help,
Rick

 
It'd be easier to do that on the page that processes the form values. All the form element names are in the Request.Form array and you could use a loop to get the name and prepend the value with that.

Lee
 
Thanks trollacious,

I'm not familiar with working with the Request.Form array, can you give me a quick example of how this would be done to get me started?

Thanks again,
Rick
 
How do you process the form data on the page that it's submitted to? The Request.Form I referred to is from ASP, but would be different if you use PHP, ColdFusion, or some other scripting language. Without knowing what server-side scripting language you're using, I can't answer your question.

Lee
 
Just out of curiosity, is this a homework assignment? Your questions are SO basic about forms that you could easily find the answers in a search on Google, faster than posting your questions here.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top