agantony
-
Total Posts
:
15
- Scores: 0
-
Reward points
:
0
- Joined: 3/23/2007
-
Status: offline
|
Setting Value From DB
Saturday, April 14, 2007 4:16 AM
( permalink)
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>
|
|
|
|
Snipah
-
Total Posts
:
1339
- Scores: 8
-
Reward points
:
0
- Joined: 11/1/2004
- Location: Scotland
-
Status: offline
|
RE: Setting Value From DB
Saturday, April 14, 2007 7:43 AM
( permalink)
so you want the db content enumerated in the <option> lists?
|
|
|
|
agantony
-
Total Posts
:
15
- Scores: 0
-
Reward points
:
0
- Joined: 3/23/2007
-
Status: offline
|
RE: Setting Value From DB
Saturday, April 14, 2007 3:40 PM
( permalink)
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
|
|
|
|
Snipah
-
Total Posts
:
1339
- Scores: 8
-
Reward points
:
0
- Joined: 11/1/2004
- Location: Scotland
-
Status: offline
|
RE: Setting Value From DB
Saturday, April 14, 2007 9:30 PM
( permalink)
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...)
|
|
|
|