Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2004, 01:08 PM
Authorized User
 
Join Date: Nov 2004
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default corrupt string after a Request.Form...

I have a Hidden input like this

<INPUT TYPE='HIDDEN' NAME='criteria' VALUE= '" & strCriteria & ">"

Where strCriteria is a string containing the criteria for a filter

it kind of look like

firstField LIKE 'something' AND secondField LIKE 'somethingElse'

But after the code here
strTemp = Request.Form("criteria")

strTemp only return: firstField LIKE

I kind of loose a part of the string

Why???

Thank you very much again for spending time to answer my question

Johnjohn


 
Old November 10th, 2004, 01:18 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi johnjohn,

The single quote in your value is closing the value attribute of the input field & the rest is getting ignored.

One way to solve it would be to use double quotes around your attribute values and encode the value...
Code:
"<input type=""hidden"" name=""criteria"" value=""" & Server.HTMLEncode(strCriteria) & """>"
HTH,

Chris

 
Old November 10th, 2004, 05:31 PM
Authorized User
 
Join Date: Nov 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What i think it should go like this:

<INPUT TYPE="HIDDEN" NAME="criteria" VALUE= '" & strCriteria & "'>"

It must display your full string! :)




Farzan Q.
BS(TeleCommunication)
Iqra University.
 
Old November 15th, 2004, 12:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Farzan,

That wouldn't work the way it was expected, as it still uses single quotes around the string. Chris's solution would solve that. Else John should use DOUBLE quotes around the string in the VALUE attribute. Something like this...
Code:
Response.write "<INPUT TYPE=""HIDDEN"" NAME=""criteria"" VALUE= """ & strCriteria & """>"
Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Request.Form / Request.QueryString Toran Classic ASP Databases 4 January 17th, 2007 02:23 PM
request.form() lucian Dreamweaver (all versions) 1 November 7th, 2004 09:14 AM
request.qurystring vs. request.form Durwood Edwards Classic ASP Databases 3 June 18th, 2004 12:09 AM
Removing @domain.com from a Request.Form(string) jturlington Classic ASP Basics 1 May 19th, 2004 04:52 PM
request.querystring() , request.form() alyeng2000 ASP.NET 1.0 and 1.1 Basics 1 December 30th, 2003 12:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.