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!

IF....Response.Write("ARGGH") 1

Status
Not open for further replies.

schase

Technical User
Sep 7, 2001
1,756
US
Hi all,

I'm trying to place a value into either a hidden field or a text box with a value.

The value can come from either a querystring or if the querystring is empty - then from a recordset.

<input type=&quot;text&quot; name=&quot;txtModelNumber&quot; class=&quot;inputbox&quot; Value=&quot;<%If request.Querystring(&quot;ModelName&quot;) <> &quot;&quot; Then Response.Write(&quot;<Request.Querystring('ModelName')>&quot;)
Else
response.write(&quot;<%=rsModel.Fields.Item(&quot;ModelName&quot;).Value%>&quot;)
End If
%>&quot;>

I Cant seem to get the proper order of quotation marks, or I dont know what.

Any ideas? &quot;Damn the torpedoes, full speed ahead!&quot;

-Adm. James Farragut

Stuart
 
<input type=&quot;text&quot; name=&quot;txtModelNumber&quot; class=&quot;inputbox&quot; Value=&quot;<%If request.Querystring(&quot;ModelName&quot;) <> &quot;&quot; Then Response.Write Request.Querystring(&quot;ModelName&quot;)
Else
response.write rsModel(&quot;ModelName&quot;)
End If
%>&quot;>
 
Try this:

<input type=&quot;text&quot; name=&quot;txtModelNumber&quot; class=&quot;inputbox&quot; Value=&quot;
<%If request.Querystring(&quot;ModelName&quot;) <> &quot;&quot; Then
Response.Write(Request.Querystring(&quot;ModelName&quot;))
Else
response.write(rsModel.Fields(&quot;ModelName&quot;))
End If
%>&quot;>

Because your IF statement is within the <% %>, you just write the values directly, without quotes or <% in your response.write statement.
 
Perfecto, thanks! &quot;Damn the torpedoes, full speed ahead!&quot;

-Adm. James Farragut

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top