...

View Full Version : Resolved text placement question



DanielHowden
11-12-2010, 04:52 PM
I want the inserted text to be under the droplist not on top of it!

<html>
<body>

<script type="text/javascript">
function showSelected(val)
{
document.getElementById('selectedResult').innerHTML="<a href='mailto:" + val + "'>" + val + "</a><p><font size=3></font>&nbsp;</p>"
}
</script>

<div id='selectedResult'></div>
<!-- This sets up the drop down list of names -->
<select name='test' onChange='showSelected(this.value)' ID=Select1>
<option value='user.1@email.net'>First User</option>
<option value='user.2@email.net'>Second User</option>
</select>

</body>
</html>

connollyc4
11-12-2010, 04:57 PM
I want the inserted text to be under the droplist not on top of it!

<html>
<body>

<script type="text/javascript">
function showSelected(val)
{
document.getElementById('selectedResult').innerHTML="<a href='mailto:" + val + "'>" + val + "</a><p><font size=3></font>&nbsp;</p>"
}
</script>

<div id='selectedResult'></div>
<!-- This sets up the drop down list of names -->
<select name='test' onChange='showSelected(this.value)' ID=Select1>
<option value='user.1@email.net'>First User</option>
<option value='user.2@email.net'>Second User</option>
</select>

</body>
</html>




<html>
<body>

<script type="text/javascript">
function showSelected(val)
{
document.getElementById('selectedResult').innerHTML="<a href='mailto:" + val + "'>" + val + "</a><p><font size=3></font>&nbsp;</p>"
}
</script>


<!-- This sets up the drop down list of names -->
<select name='test' onChange='showSelected(this.value)' ID=Select1>
<option value='user.1@email.net'>First User</option>
<option value='user.2@email.net'>Second User</option>
</select>
<div id='selectedResult'></div></body>
</html>



Like that?

Philip M
11-12-2010, 04:59 PM
This is not a javascript issue.

Just move your <div> to the desired postion - after the select list.

Note that if you use onchange you must have a default such as "Select User" as otherwise user1 can only be selected by first selecting user2.

Do please read the posting guidelines regarding silly thread titles. This is the second thread today with the same silly title. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. You can (and should) edit it to make it more meaningful.

Also rememember when posting here to use [ code ] tags.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

DanielHowden
11-12-2010, 05:32 PM
thanks for the reply guys. I am sorry that it was not the javascript that was the issue. I am new to this and I thought it was. Sorry.

Daniel.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum