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!

Wrong Value

Status
Not open for further replies.

jimmythegeek

Programmer
May 26, 2000
770
US
I have VBScript that is pulling data from a SQL Server Database. Everything works fine except for one field. It is a smalldatetime field in SQL Server, and when I Response.Write the value from the table, I get the correct value (4/1/01).

However, when I Response.Write Request.Form("txtPhaseDate"), I get this value
(, 4/1/01).

The following is the script that I have in the middle of a table:

=====
Response.Write &quot;<td>Target Completion (current phase):</td>&quot;
Response.Write &quot;<td><Input Type='Text' Name='txtPhaseDate' Size=8 Class='Typical' value='&quot; & rs(&quot;PhaseDate&quot;) & &quot;'></td></tr>&quot;
=====

I have this one below it, and it works just fine:
=====
Response.Write &quot;<td>Target Completion (project):</td>&quot;
Response.Write &quot;<td><Input Type='Text' Name='txtProjCompDate' Size=8 Class='Typical' value='&quot; & rs(&quot;ProjCompDate&quot;) & &quot;'></td></tr>&quot;
=====

If the value is correct in the table, why would it be showing the value preceded by a comma and a space on the form ???

Thanks in advance,
Jim Lunde
compugeeks@hotmail.com
Custom Application Development
 
hmmm... not sure, but here's a nice little hack that would fix it right up...

dim newVar
newVar = replace(request.form(&quot;txtPhaseDate&quot;), &quot;,&quot;, &quot;&quot;)
newVar = replace(newVar, &quot; &quot;, &quot;&quot;)

now, your newVar would have the desired value in it with no commas and no spaces.

:)
Paul Prewett
 
Hi jimmythegeek,

Please check the Name of all the form Field. u are using two times same name &quot;txtPhaseDate&quot;.

Change the Name of One field.

Hope this will help you.

Anand

Anand
anandm@entcomm.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top