Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Capturing Data Values in HTML Form


Message #1 by "Stephen Proctor" <steveproctor@c...> on Mon, 4 Feb 2002 23:39:13
I'm trying to get information from a database into a text box, allow the 

user to change it, and then reload the data into the database.  I've used 

this method before by utilizing server variables.  But now I'm having 

trouble using simple variables.



I've opened the connection to the database and obtained the recordset 

(I've used Response.Write to show the data, so that part seems OK.)  But 

my form won't show the data.  Here's the code snippet:



'Set the variables

Dim strDirector1

'Put the database data into the variable

objRS("Director1") = strDirector1

'Later I try to insert the data into an HTML form as follows:



<p align="left">First Director Name  

      <input type="text" size="50" name="<%=strDirector1%>"><br>

</p>



But the HTML source indicates:  name=""



Any ideas?



Thanks very much for help.



Steve
Message #2 by "Ken Schaefer" <ken@a...> on Tue, 5 Feb 2002 11:41:35 +1100
: 'Put the database data into the variable

: objRS("Director1") = strDirector1



The above isn't going to work. Think back to alegbra in high school:



' Set the variable to a value:

5 = x



is what you are doing at the moment. You want it to be the other way around:

x = 5



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Stephen Proctor" <steveproctor@c...>

Subject: [access_asp] Capturing Data Values in HTML Form





: I'm trying to get information from a database into a text box, allow the

: user to change it, and then reload the data into the database.  I've used

: this method before by utilizing server variables.  But now I'm having

: trouble using simple variables.

:

: I've opened the connection to the database and obtained the recordset

: (I've used Response.Write to show the data, so that part seems OK.)  But

: my form won't show the data.  Here's the code snippet:

:

: 'Set the variables

: Dim strDirector1

: 'Put the database data into the variable

: objRS("Director1") = strDirector1

: 'Later I try to insert the data into an HTML form as follows:

:

: <p align="left">First Director Name

:       <input type="text" size="50" name="<%=strDirector1%>"><br>

: </p>

:

: But the HTML source indicates:  name=""



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Message #3 by "mAn\[S\]o0r aD3nWalA" <mansoor_adenwala@y...> on Tue, 5 Feb 2002 01:06:10 -0800 (PST)
--0-1012526781-1012899970=:43267

Content-Type: text/plain; charset=us-ascii





hi stephen



ur problem maybe on this line, 



objRS("Director1") = strDirector1



try using 



strDirector1 = objRS("Director1")







mAn[s]o0r T aD3nWaLa

Mujhe yaad tum karte ho 

Aksar bhool kar 

Main to bhool hi na paai tumhe 

Kya yaad karoongi ae bekhabar.







---------------------------------

Do You Yahoo!?

Send FREE Valentine eCards with Yahoo! Greetings!


Message #4 by "Stephen Proctor" <steveproctor@c...> on Tue, 5 Feb 2002 14:48:53
Thanks for your help.  The problem is solved!  You were correct and, in 

addition, I found another silly error.  As you can see, I'm not a 

professional programmer, but I do help my daughter with her algebra on 

occassion.



Steve



> I'm trying to get information from a database into a text box, allow the 

> user to change it, and then reload the data into the database.  I've 

used 

> this method before by utilizing server variables.  But now I'm having 

> trouble using simple variables.

> 

> I've opened the connection to the database and obtained the recordset 





> (I've used Response.Write to show the data, so that part seems OK.)  But 

> my form won't show the data.  Here's the code snippet:

> 

> 'Set the variables

> Dim strDirector1

> 'Put the database data into the variable

> objRS("Director1") = strDirector1

> 'Later I try to insert the data into an HTML form as follows:

> 

> <p align="left">First Director Name  

>       <input type="text" size="50" name="<%=strDirector1%>"><br>

> </p>

> 

> But the HTML source indicates:  name=""

> 

> Any ideas?

> 

> Thanks very much for help.

> 

> Steve

  Return to Index