Problem with onsubmit ID
Posted
by
Liso22
on Stack Overflow
See other posts from Stack Overflow
or by Liso22
Published on 2010-12-28T00:43:03Z
Indexed on
2010/12/28
0:54 UTC
Read the original article
Hit count: 162
I need an onsubmit to return false if what's written on the first field is a certain PHP value however the field has a strange id format and I'm not quite sure how to add it in the onsubmit.
This is the form, I didn't add the element ID to it:
<form class="questionform" name="questionform-0" id="questionform-0" onsubmit="if (document.getElementById('').value == '<?php echo $casi; ?>') return false;"
>
<textarea class="question-box" style="width:97%;" cols="20" rows="4" id="question-box-' . $questionformid . '" name="title" type="text" maxlength="80" size="28" value=""></textarea>
I tried many times but couldn't add it. How should I do it? Thanks
© Stack Overflow or respective owner