Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 08-16-2005, 12:12 PM if --- then problems
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 08-16-2005, 12:40 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
Try something like this:
Code:
selected=false

if request.form("portals") <> "" and request.form("portals") <> "Select portal" then
    selected=true
end if
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 08-16-2005, 12:51 PM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
yes that does work although i am now amis as to why that does and mine didnt.

Addionally could you help with the next problem i have with this screen. The slect is not maintained when the form is submited in that its initial value returns the the first value in the select. Is it possible to prevent this?
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Reply     « Reply to if --- then problems
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30110 seconds with 12 queries