Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Assign local variable to hidden field

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,3084
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Assign local variable to hidden field
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Assign local variable to hidden field - 5/23/2005 3:38:10 AM   
  Millerpr

 

Posts: 1
Score: 0
Joined: 5/23/2005
From:
Status: offline
How do I assign a local variable to a form hidden field element?
eg
Dim MyVar
MyVar = ( comes from an include file which sets the value of MyVar from a cookie. This local variable and many more are then used as parameters for my recordsets and work OK. This speeds things up since the cookie is only accessed once for multiple recordsets )

However, when I try to assign it to a hidden field -
<input type="hidden" name="HiddenField" value="MyVar">

The value assigned is "MyVar" and not the value previously assigned to MyVar.
What am I missing?
 
 
Post #: 1
 
 Re: Assign local variable to hidden field - 5/25/2005 2:09:36 PM   
  VBS

 

Posts: 110
Score: 0
Joined: 3/2/2005
From: Lebanon
Status: offline
Dear Millerpr,
Can u please explain more, cause i really didn't get ur point

(in reply to Millerpr)
 
 
Post #: 2
 
 Re: Assign local variable to hidden field - 5/26/2005 8:13:44 AM   
  Salboaski

 

Posts: 1
Score: 0
Joined: 5/26/2005
From:
Status: offline
One way to do that is make the entire line part of the code by doing somehting like

Response.Write "<input type='hidden' name='hiddenField' value='"& MyVar &"'>"

or if you just want to elave the html in its own section you can do

<input type="hidden" name="HiddenField" value="<%Response.Write MyVar%>">

at least thats how I set my variables. Hope this helps.

(in reply to Millerpr)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Assign local variable to hidden field Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts