[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Option button in ASP

Posted on 2004-03-26
5
Medium Priority
?
309 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 320 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

649 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