0

hello daniweb web developers i am beginner with programing and i want to know how to make this one..if i select a item for example CA on <select box> how to put a confirmation message that will be put in the <div> tag? i'm hoping you could help me sir..regards -aizel

<script type='text/javascript'>
function madeSelection(elem, helperMsg){
    if(elem.value == "Please Choose"){
        alert(helperMsg);
        elem.focus();
        return false;
    }else{
        return true;
    }
}
</script>
<form>
Selection: <select id='selection'>
<option>Please Choose</option>
<option>CA</option>
<option>WI</option>
<option>XX</option>
</select>
<div id"confirmation"></div>
<input type='button' 
    onclick="madeSelection(document.getElementById('selection'), 'Please Choose Something')"
    value='Check Field' />
</form>
1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by aizel
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.