Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Setting Value From DB

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Setting Value From DB
  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 >>
 Setting Value From DB - 4/14/2007 3:16:09 AM   
  agantony

 

Posts: 15
Score: 0
Joined: 3/23/2007
Status: offline
Hi All,

I have a update page that has a dropdown list. I am tyying to set the selcted option from the DB. Is this possible the to achive it in this way?

Your advice is appreciated.. Many thanks

***********************************************************************************************************

<% strSelected =(RS("CALLSTATUS")) %>

<HTML CODE >

     <td width="120" class="fields"><div align="right">STATUS:</div></td>
     <td colspan="2" class="body"><select name="CALLSTATUS" size="1" class="body" id="CALLSTATUS">
       <option value="Call Open" > Call Open</option>
       <option value="Call Pending">Call Pending</option>
       <option value="Call Closed"> Call Closed</option>
 <option selected <%=(strSelected)%> </select></td>
   </tr>

<HTML END>
 
 
Post #: 1
 
 RE: Setting Value From DB - 4/14/2007 6:43:23 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
so you want the db content enumerated in the <option> lists?

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to agantony)
 
 
Post #: 2
 
 RE: Setting Value From DB - 4/14/2007 2:40:36 PM   
  agantony

 

Posts: 15
Score: 0
Joined: 3/23/2007
Status: offline
Hi Snipah,

I dont think I have explained myself properly. I am using asp to write to a database. The snippet of code above, loads a record from the DB to be updated. One of the fields of the update form is a drop down list containing 3 values Call Pending, Call Closed and Call Open. I am trying to select the relevant option from the list using a value (Call Pending, Call Closed and Call Open) from the record when the database record is loaded.

Likewise, I have 2 check boxes (Yes / No) on the same update form, and I would also like to check the relevent button from a value stored in the database record. any suiggestions?


Regards

(in reply to Snipah)
 
 
Post #: 3
 
 RE: Setting Value From DB - 4/14/2007 8:30:36 PM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
confirm if this is the direction you want (taking the checkbox example)

If dbValueYesNo = "yes" Then
document.getElementByID("optCheckBoxYES").checked = true
document.getElementByID("optCheckBoxNO").checked = false
Else
document.getElementByID("optCheckBoxYES").checked = false
document.getElementByID("optCheckBoxNO").checked = true
End If

(same applies for the option list, only that takes different attributes...)

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to agantony)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Setting Value From DB 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