|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
<select> option problem
Hi;
I have a asp page called DocumentationPage.asp I have option buttons here they are the project names. Users select a project here and view its documents etc.... The problem is after viewing the documents when coming back to DocumentationPage.asp,the selected project is set deselected how can I achieve this problem.I tried using a variable(passing through querystring) but within <script>....</script> tags I can not be able to use that variable <% dim projectname=request.querystring("Project") if projectname <>"" then %> <script> var i; i=0; while(i<document.Projects.pn.length){ if(document.Projects.pn[i].value=</script><% & projectname & %><script>){ } i=i+1; } </script> There is also another error ; when this vbscript is running there is no radio buttons yet !! Can you please help me?? |
|
#2
|
|||
|
|||
|
you could do the following in your form; doing everything server-side
Code:
<%
Dim projectName = Request.QueryString("project")
'create your option buttons, I assume you use a recordset
Do While Not oRs.EOF
Response.Write "<input type=""radio"" name=""pn"" value=""" & oRs("projectName") & """
If Trim(projectName) = Trim(oRs("projectName")) Then Response.Write " checked"
Response.Write ">" & oRs("projectName") & "<br>"
oRs.MoveNext
Loop
oRs.Close%>
This way you check the radio button which matches the querystring. And since this is all done server side, the form will just come up with the radio button selected. Hope this helps
__________________
- Rogier Doekes |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > <select> option problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|