We help IT Professionals succeed at work.

Cannot retreive a value on form Post

mmalik15
mmalik15 asked
on
On my ASP form I have input field
<input name="JournalVolume" value="<%=JournalVolume%>">

When I retreive the value inside the posted form as below
<input type="text"  name="txtJrlVol" size="50" value=<%= Request.Form("JournalVolume") %></input></Td>


it only pulls the first word of the form. E.g. if user enters , hello world, it only pulls, hello

Any ideas what I could be doing wrong

Comment
Watch Question

Commented:
use HttpUtility.UrlEncode method around Request.Form("JournalVolume")
Is the form method GET or POST? You can just use:

Request("JournalVolume")

Author

Commented:
The method is post and I manage to sort it out using the following expression

<input type="text"  name="txtJrlYear" readonly="true"  size="20" value="<%=Request.Form("JournalYear")%>" />

thanks

Author

Commented:
I was probably missing the double quotes after value attribute
Top Expert 2011

Commented:
@nmalik15 - Can this be closed?  If so, please accept your answer from December 4 as the Accepted Solution.  If you are still having problems, let us know!