/    Sign up×
Community /Pin to ProfileBookmark

DropDown box selection with Javascript and ASP.

What I want to do, is that, when the user select one option out of many from the dropdown box some new fields appears.

I was so close to make it ?, using this example:

[code]
<script type=”text/javascript”>
function showInfo()
{
var elem = document.getElementById(‘verify’);
if(document.forms[0].menu.value == “verify”){
elem.style.display=”inline”;}
else{
elem.style.display=”none”;}
}
</script>
</head>

<body>
<form action=”#” method=”post”>
<select name=”menu” onchange=”showInfo()”>
<option value=”none”>Select an option</option>
<option value=”email”>Email</option>
<option value=”verify”>Verify</option>
</select>

<div id=”verify” style=”display:none;”>
<input type=”text” value=”Username” >
<input type=”password” value=”password” >
</div>
</form>
[/code]

But what I do want, is that two differen things appear on the page and in the different location of the page. And this script does not read the second <div>. ? So the result is, that the only first <div> appears.

Here are some images of what I want to do.
Before:
[url]http://img82.imageshack.us/img82/7093/beforens9.jpg[/url]

After
[url]http://img246.imageshack.us/img246/2759/afterzh2.jpg[/url] (what has to be changed is on the red circules).

So can someone help me with this script?? Please! I am pritty noob to the javascript. ?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @sovik 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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