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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form document variable does not like spaces

Status
Not open for further replies.

wluu

Programmer
Feb 21, 2003
7
CA
hey guys. This one is really bugging me. I have a form which contains some variables. One of the form variable("Description") is a textarea where someone can input text into. Now within my vbscript section, I declare a variable (sHDescription) to hold the "description" value. Since description contains spaces in it, the first space the string encounters and everything before the space is added to the vbscript variable and everything else after the space is not. Is there anyway of obtaining the entire string including spaces and storing it in sHDescription?

Here is a sample of my code:

<form name=hiddenform>
<INPUT type=hidden name=Description_hidden value=<%=Request.form(&quot;Description&quot;&sID)%>>
</form>

<script language=&quot;vbscript&quot;>
sHDescription = document.hiddenform.Description_hidden.value
msgbox sHDescription
</script>

The description_hidden above grabs its info from a previous form and the vbscript section grabs this information. However since description_hidden value is a string that contains spaces, sHDescription will truncate its value. For example:
description_hidden value => &quot;This is a test&quot;
sHDescription value => &quot;This&quot;

Any help would be greatly appreciated.

 
Try putting quotes around your value...

<INPUT type=hidden name=Description_hidden value=&quot;<%=Request.form(&quot;Description&quot;&sID)%>&quot;>
BDC.
 
tks bdc. that's what i did and it worked. Forget two little quotes and it costs me about half a day of work :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top