berkshirea
Technical User
Hi guys,
I have this code. It's a required dropdown. When a user selects 'Red' or 'Blue', the form should submit. When the user selects 'web' a textfield appears and that textfield is required to be filled in. My problem is, when the user selects 'Red' or 'Blue', the form does not submit. Can you please give me some idea of how to go about it? Thanks guys.
I have this code. It's a required dropdown. When a user selects 'Red' or 'Blue', the form should submit. When the user selects 'web' a textfield appears and that textfield is required to be filled in. My problem is, when the user selects 'Red' or 'Blue', the form does not submit. Can you please give me some idea of how to go about it? Thanks guys.
Code:
<html>
<head>
<script type="text/javascript">
function CheckColors(val){
var element=document.getElementById('weburl');
if(val=='web')
element.style.display='block';
else
element.style.display='none';
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="dfgdfgdfgd.html">
<select name="color" onchange='CheckColors(this.value);'>
<option>pick a color</option>
<option value="red">RED</option>
<option value="blue">BLUE</option>
<option value="web">web</option>
</select>
<input type="text" name="weburl" required id="weburl" placeholder="URL here please" style='display:none;'/>
<input type="submit" id="Submit" name="Submit" value="Submit" />
</form>
</body>
</html>