-
problems with if .... then
Hi,
Im using the below form with select in portal-referal.asp
<form style="margin-bottom:0px;" name="portals" action="portal-referal.asp">
<select name='portals' onChange='this.form.submit()'>
<option value='Select portals'>Select portals</option>
<option value='Money'>Money</option>
<option value='Your Studies'>Your Studies</option>
<option value='Get Support'>Get Support</option>
<option value='Getting Arround'>Getting Arround</option>
<option value='Kingsotn Life'>Kingsotn Life</option>
<option value='Your University'>Your University</option>
<option value='Accommodation'>Accommodation</option>
<option value='International'>International</option></select>
</form>
In my code, within portal-referal.asp, under option explicit, I check :
selected=false
if request.form("portals") <> "" then
if request.form("portals") <> "Select portal" then
selected=true
end if
end if
MY problem is that 'selected' is ALWAYS false even when i make a selection on the form.
I can't figure if it's the 'if then' or because when the page returns to the client, the <select> is reset.
Could some one please help.
cheers.
-
if request.form("portals") <> "" and request.form("portals") <> "Select portal" then
selected = true
else
selected = false
end if
try this
if you do not want the list to reset, you have to set the value dynmically. Check the returned value and put the "selected" attribute in <option ...> tag dynamically.
Sajjad
Software & Web Developer in Pakistan - .NET, PHP and ASP.
Free Jokes
Buy Viagra, Buy Cheap Kamagra, Cheap Kamagara Jelly Soft, Cheap Cialis, Levitra, Lovegra, Penegra, Reductil, Lipitor, Zocor at our Online Pharmacy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules