azrina
04-28-2006, 12:35 AM
Hi all.
I use list/menu in my web application.
I am having problem for the list/menu to hold the value entered by user if there are alert message displayed after clicking submit button.
The page will be refreshed and I want the same data to be hold there.
So, I have used session() to store the data. But, the problem is it works only with textfield not for the list/menu. Only textfield in the page can store the data. May be, I didnt know the correct code for that.
Here, I enclose my code for the list menu and hope that anyone here can help me correct the code. Thanks in advance.
<select name ="negeri" class="text_normal" id="negeri">
<%
set gnegeri = server.CreateObject("adodb.recordset")
gnegeri.open "select * from negeri" ,conn
if not gnegeri.eof then
for y=1 to gnegeri.recordcount
%>
<option value="<%=gnegeri("id")%>" <%if gnegeri("id") = session("negeri") then response.Write("selected") end if%>>
<%=gnegeri("nama_negeri")%></option>
I use list/menu in my web application.
I am having problem for the list/menu to hold the value entered by user if there are alert message displayed after clicking submit button.
The page will be refreshed and I want the same data to be hold there.
So, I have used session() to store the data. But, the problem is it works only with textfield not for the list/menu. Only textfield in the page can store the data. May be, I didnt know the correct code for that.
Here, I enclose my code for the list menu and hope that anyone here can help me correct the code. Thanks in advance.
<select name ="negeri" class="text_normal" id="negeri">
<%
set gnegeri = server.CreateObject("adodb.recordset")
gnegeri.open "select * from negeri" ,conn
if not gnegeri.eof then
for y=1 to gnegeri.recordcount
%>
<option value="<%=gnegeri("id")%>" <%if gnegeri("id") = session("negeri") then response.Write("selected") end if%>>
<%=gnegeri("nama_negeri")%></option>