/    Sign up×
Community /Pin to ProfileBookmark

Drop down menu problem

Hi,

Trying to do… : Have a drop down menu. Upon pressing submit button a whole bunch of information is displayed on the same screen about the person selected.

Problem… : When selected person and pressed submit the last persons information is displayed every time. It does not recognise my selection from the drop down menu.

Possible cause….: I do not think that the code is recognising the selection, infact I am not sure if I am using the correct select field for the selection.

solution….: Need a little guidance from you guys.

Sample code….:

Here is my drop dowm menu :

<td width=”194″><select name=”Aselect” id=”Aselect”>
<option value=”a”>Person1</option>
<option value=”b”>Person2</option>
<option value=”c”>Person3</option>
<option value=”d”>Person4</option>
</select></td>

Here is my select code to display information about person1and2 :
Note : I have tried Aselect =”a” as well as Aselect = “Person1”

if (Aselect = “a”)
{
form1.text1.value = “Info about person1 “;
form1.text2.value = “Info about person 1”;
form1.text3.value = “Info about person 1”;
}
if (Aselect = “b”)
{
form1.text1.value = “Info about person2 “;
form1.text2.value = “Info about person2 “;
form1.text3.value = “Infoabout person 2”;
}

But every time the last set of details are being displayed and not the ones from the person selected from the drop down.

Thanks.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisOct 13.2009 — First error I see is using "=" in a compare statement. You should use "==" to cmpare.
×

Success!

Help @Zoso1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...