many_tentacles
09-05-2008, 03:17 PM
Hi
I have a bit of a problem which I can't for the life of me work out.
I have a javascript which changes the content of a layer depending on which dropmenu item is selected.
This is all good, but i then wanted to put another piece of javascript in the content that is revealed. There's a fairly obvious " and ' issue here though.
Here's the basics of the code I'm trying to sort out. Any ideas would be much appreciated.
Thanks
I also can't get the javascript alert to work... any ideas on this one??
<script type="text/javascript">
<!--
function PopUp(mesid,txt){
var messobj=document.getElementById(mesid);
messobj.innerHTML=txt;
}
-->
</script>
<form name="form1" id="form1">
<select name="menu1" onchange="PopUp('caption',value)">
<option value="<h3>Select the next option from the list above</h3>">Select the next option</option>
<option onfocus="javascript:alert('ALERT HERE');" value="<p><a href='mylink.html' target='_blank' onclick='javascript:alert ("This is a Javascript Alert");'>Click here for a full itinerary</a></p>">Academy Week in Portugal</option>
</select>
</form>
<div id="caption">
<h3>Select the next option from the list above</h3>
</div>
I have a bit of a problem which I can't for the life of me work out.
I have a javascript which changes the content of a layer depending on which dropmenu item is selected.
This is all good, but i then wanted to put another piece of javascript in the content that is revealed. There's a fairly obvious " and ' issue here though.
Here's the basics of the code I'm trying to sort out. Any ideas would be much appreciated.
Thanks
I also can't get the javascript alert to work... any ideas on this one??
<script type="text/javascript">
<!--
function PopUp(mesid,txt){
var messobj=document.getElementById(mesid);
messobj.innerHTML=txt;
}
-->
</script>
<form name="form1" id="form1">
<select name="menu1" onchange="PopUp('caption',value)">
<option value="<h3>Select the next option from the list above</h3>">Select the next option</option>
<option onfocus="javascript:alert('ALERT HERE');" value="<p><a href='mylink.html' target='_blank' onclick='javascript:alert ("This is a Javascript Alert");'>Click here for a full itinerary</a></p>">Academy Week in Portugal</option>
</select>
</form>
<div id="caption">
<h3>Select the next option from the list above</h3>
</div>