Jump to content

text not submitting

Recommended Posts


I have a codeĀ  where am using a select drop down and for 5th variable a text box will be opened and need to enter the value.

But the entered value is not submitting at the server .

 <form action="/COHARToutputsimulation" id="chout" method="post" target="formDestination">

                        <font size="5"> <strong>Output Simulation-HART:
<select name="selected" onchange="cooutsim(this.value)">
  <option value="0"> Simulate - 4 mA</option>
  <option value="1">Simulate - 8 mA</option>
  <option value="2">Simulate - 12 mA</option>
  <option value="3">Simulate - 16 mA</option>
  <option value="4">Simulate - 20 mA</option>
  <option value="5">Simulate value </option>
<input type="text" id="ousi" size="10px" style="display:none;">
<input type="submit" style="font-size:10pt;" onclick="chrtout(event)">
function cooutsim(val)
	if(val == 5)
function chrtout(event) {
   var myForm  = document.getElementById('chout');
   formData = new FormData(myForm);
     var xhttp = new XMLHttpRequest();
     xhttp.onreadystatechange = function() {
       if (this.readyState == 4 && this.status == 200) {
         document.getElementById("chout").innerHTML =this.responseText;

     xhttp.open("POST", "COHARToutputsimulation",true);
     return true;


What is the issue am not getting.

Please suggest

Thanks and Regards

Rizwan Syed

Share this post

Link to post
Share on other sites

You need a name attribute value, NO value means there won't be any identifier to retrieve the value. All form inputs, submit, textarea, select etc require name attribute value

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...