Quote:
Originally Posted by Boofo
The javascript I posted above it how it has to be. This is for realchat and that's how he says to do it in the program. I have a page called extras that this is located on and where the rest of it has to go. Not much I can do about that, I'm afraid. This code goes in an html page, by the way.
The drop down was my idea as I wanted to be able to click it and have it send a warning to the user. There's no way to do that with this? 
|
HTML Code:
<td>
<form name=Warn>
<B>Warn:</B> <select onchange="javascript:alert(this.options[selectedIndex].value);">
<option value="">--------</option>
<option value="Hi _USER_!";"Is everything ok?">Hi there!</option>
</select>
</form>
</td>
Change this to
HTML Code:
<td>
<form name="warn">
<B>Warn:</B> <select onchange="gimmesomesugar(this.options[selectedIndex].value);">
<option value="">--------</option>
<option value="Hi _USER_!:Is everything ok?">Hi there!</option>
</select>
</form>
</td>
Add somewhere in the <head> tags
HTML Code:
<script type="text/javascript">
<!--
function gimmesomesugar(sugar)
{
var somesugar = sugar.split(":");
alert( somesugar[0], somesugar[1] );
}
//-->
</script>
This should call the same alert function you have scripted in your first post, unless the regular javascript
alert() function steps in and takes over