I'm writing a form and use document.form.submit()
to post value, and I hope I can use x = http.formvalue("")
to get the value well. But I found if I submit <span>
value then I'll get null
, if I replace <span>
to <input>
then I can get the value well, can anyone help me get the value only use <span>
? thx!
HTML
<form id="form1" name="form1" method="post">
<ul class="formUl">
<li>
<span class="clm01">Phone:</span>
<span class="clm02" id="phone" name="phone"></span>
</li>
</ul>
<a class="submitBtn" href="#" onclick="apply()">Apply</a>
</form>
jQuery
function apply() {
document.form1.submit();
}
span
is not a form element. Form elements areinputs
,selects
,radios
,textareas
, etc. That is why it works when you change it to aninput
.