Cannot post span value by document.form.submit

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();
}

Answers:

Answer

span is not a form element. Form elements are inputs, selects, radios, textareas, etc. That is why it works when you change it to an input.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.