Newbie Spellweaver
- Joined
- Jul 5, 2011
- Messages
- 15
- Reaction score
- 0
Hello, i'm now making one Website of entertainment, i'm coding the Contact form right now, i've been coding this for about 2 hours, and now i've found 1 error.
I've made one Subject with multiple options, and one option is called "Other Problem" it will open one text bar behind the options that allow people to write what problem they are having that isn't current listed at the options made, but watch something weird happend.
The first option, even if i delete that option, it will always allow people to write i want it to allow people to write only if people click " Other Problem "
JavaScript :
HTML Script :
Ill wait one answer.
Thanks.
I've made one Subject with multiple options, and one option is called "Other Problem" it will open one text bar behind the options that allow people to write what problem they are having that isn't current listed at the options made, but watch something weird happend.
The first option, even if i delete that option, it will always allow people to write i want it to allow people to write only if people click " Other Problem "
JavaScript :
Code:
<script type="text/javascript">
function toggleElements(formObj,selectObj)
{
formObj.elements["dateavail"].style.display = "none";
{
if(selectObj.value=='sendinfo' || selectObj.value=='inform')
{
}
if(selectObj.value=='inform')
{
formObj.elements["dateavail"].style.display = "inline";
}
if(selectObj.value=='available')
{
formObj.elements["dateavail"].style.display = "inline";
}
}
return false;
}
</script>
HTML Script :
Code:
<tr>
<td>Subject :<br>
<body onload="toggleElements(document.getElementById('contactform'));">
<div>
<select name="subject" onchange="toggleElements(this.form,this);" style="border: solid 1px #000;">
<option value="Escolhe uma opção" class="active">Choose one option</option>
<option value="Problemas no website">Problemas no website</option>
<option value="Falha de canais">Falha de canais</option>
<option value="Falha de Rádios">Falha de Rádios</option>
<option value="Erros encontrados">Erros encontrados</option>
<option value="Dúvidas">Dúvidas</option>
<option value="available">Other problem?</option>
</select>
<br>
<label for="dateavail">Write another problem :</label>
<input type="text" name="dateavail" id="dateavail" value="<?=$_SESSION['post']['dateavail']?>" style="border: solid 1px #000;" />
</div>
</body>
</html>
</td>
</tr>
Ill wait one answer.
Thanks.
Attachments
You must be registered for see attachments list