Forums

ASP

This topic is locked

Value to be Selected from QueryString(in DDL)

Posted 26 Oct 2006 11:09:18
1
has voted
26 Oct 2006 11:09:18 Fouad Akhtar posted:
Hi,

i am working with Drop Down List in asp

My aim is to select the value (in Drop Down List) which is coming from Request.QueryString

for examply

i click at Edit link in pageONE.asp and from Edit link i am passing United States ..... so when pageSECOND.asp loads then United States should be selected in the Drop Down List

Let me show what i am trying please

from pageONE.asp .. i have Edit link ... when i click at Edit .... pageSECOND.asp loads and then i am trying to get the value in the variable as ....

DIM GetCountry

GetCountry = Request.QueryString("Country"

<form name="the_form"
method="post"
action="getval.asp" >

<select name="dropdown">
<option>--United KingDom--</option>
<option>Portugal</option>
<option>United States</option>
<option>Australia</option>
</select>
<input type="submit" value="Submit">
</form>

so how could united states value be selected

your help would be highly appreciated.

Edited by - FouadAkhtar on 29 Oct 2006 13:33:27

Replies

Replied 27 Oct 2006 01:29:11
27 Oct 2006 01:29:11 Dan Berdusco replied:
This is very doable and quite simple...

Just create a recordset on the second page that relates to the record on the first page. Then, in the dynamic dropdown list, where is says "select value equal to:" - select the country field from the that list.

Hope i wasn't too vague.
Replied 28 Oct 2006 00:18:17
28 Oct 2006 00:18:17 Fouad Akhtar replied:
i reallly did not understand .... i am new in asp ... i need details with code please
Replied 29 Oct 2006 13:47:06
29 Oct 2006 13:47:06 Fouad Akhtar replied:
seems like no one understood my question

i am gonna repeat again

in my first page, i have drop down list with few countries, and a submit button
and when we selects the country and click at submit button ...
it takes to the second page which is basically a confirmation page ... in this page the selected value i am printing
Now if i say ...... that the country i have selected is wrong .... then i have given Edit link which takes to the firstpage.asp and this link contains the country name ..... like firstpage.asp?id=United States

now here is my question

when edit link clicks then United States should be selected in DDL of the firstpage.asp

please i need help .. thanks
Replied 08 Nov 2006 16:47:46
08 Nov 2006 16:47:46 Steve Bedder replied:
If I've understood your question correctly, I think this should do it.....

<select name="dropdown">
<option selected><%Request.QueryString("Country"%></option>
<option>--United KingDom--</option>
<option>Portugal</option>
<option>United States</option>
<option>Australia</option>
</select>

HTH

SteveB

Reply to this topic