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

Multi-word problem on request.form 1

Status
Not open for further replies.

AWithers

MIS
Mar 7, 2002
402
GB
iis5, win2000 server, winnt4 client, ie5.5, form method=post

I'm reasonably new to asp so apologies if this is a very obvious request but I have a problem that the values being passed over to request.form are truncated at the end of the first word e.g.country of france is passed fine but country of United Kingdon results in just United.


code is as follows:-

if request.form("Country")="" then
strcountry="%"
else
strcountry = request.form("Country")
Response.write "Country: "+strcountry
end if

I'm sure I am missing a trick here but have compared my code with pages that work perfectly and now I am stumped...any ideas

Andy
 
if request.form("Country")="" then
strcountry="%"
else
strcountry = request.form("Country")
Response.write "Country: " & strcountry
end if


Try and & symbol.. and see what happens
star.gif
if I helped. [wink]
s_vzio.gif
 
well try this ..

Dim strCountry

if request.form("Country")="" then
strcountry="%"
else
strCountry = Replace(Request.Form("Country"), VbCrLf, "")
Response.write "Country: " & strcountry
end if


star.gif
if I helped. [wink]
s_vzio.gif
 
Sorry, still no luck...I think it simply is not coming over from the request page properly and thus it is too late once it is on this page

Andy
 
In your FORM - make sure that the Value of the Country field is enclosed by quotes (good practice to do this with all fields). This will ensure the entire string gets sent to your action page. If you omit the quotes then only the first word will be sent.

Tony
reddot.gif WIDTH=400 HEIGHT=2 VSPACE=3

 
Well im not sure why its carriage returning your form, can i see all your code? such as the form etc.. we can get to the bottom of this, with more details on it.
star.gif
if I helped. [wink]
s_vzio.gif
 
Thanks very much FesterSXS that did the trick, silly error really

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top