Solved

Option button in ASP

Posted on 2004-03-26
5
297 Views
Last Modified: 2012-08-14
Hi,

Here is the scenario, I want the user to choose the country from the list and once the user click on the country then the other option button will list down the state of the country selected by the user without click on the submit button.
It just like the sign up page in the hotmail.
I am using access to retrieve the country.
How to do this? And is it possible all this things done in the same page without have to link to other page?

Thanks in advance
Yzh
0
Comment
Question by:Yzh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Expert Comment

by:venkateshwarr
ID: 10693884
0
 
LVL 12

Expert Comment

by:str_kani
ID: 10694060
hi,
Will you display all the countries in the world or only a few and its states, we can choose  the best one depends on the requirement. Please let me know how many countries and states you will use...
(tell me approximately)
regards
kani
0
 

Author Comment

by:Yzh
ID: 10700807
Well, I will put 10 countries but in the future I may put more..so, I want it to be dynamic..which approach is better? client-side or server-side?

Regards,
Yzh
0
 
LVL 1

Expert Comment

by:Nandhini
ID: 10958551
server side is the best approach
0
 
LVL 1

Accepted Solution

by:
Nandhini earned 80 total points
ID: 10965992
it is possible to do in a single page

page - first.asp
-----------------

<%
  ur connection stmt .............
%>
<html>
<body>
<form name="form1" method="post" action="first.asp">
<select name="country" onchange="javascript:form1.submit();">
<%
   select all the countries from the database
    If not cnt.eof then
     cnt.movefirst
     If Request.Form("country") <> "" then
       country = Request.Form("country")
     Else
       country = cnt("country_field_name")
     End If
     Do while not cnt.eof
      If strcomp(country,cnt("country_field_name"),1) = 0 then
%>
        <option value="<%=cnt("country_field_name")%>"><%=cnt("country_field_name")%> SELECTED></option>
<%
      else
%>
        <option value="<%=cnt("country_field_name")%>"><%=cnt("country_field_name")%></option>
<%
       end if
      cnt.movenext
    loop
    end if
 %>
</select>
<select name="state">
<%
  set st = conobj.execute("select states from state_table_name where country='"&country&"'")
  If not st.eof then
   st.movefirst
   Do while not st.eof
%>
     <option value="<%=st("state")%>"><%=st("state")%></option>
<%  
    st.movenext
   Loop
  end if
%>
</select>
</form>
</body>
</html>
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question