karansys
karansys

Reputation: 2729

Not getting entered data from input element

enter image description hereThis is js app in electron framework. I am trying to get the updated text entered inside text box as shown in image but I am not able to retrieve any data. I have ensured that data is submitted. I have predefined data in a file ,initally, I have this values but onform submit, I modify those values.

function setData()
{
  let server = mapServers[i];

  var htmlForThisHostID = '<tr>';

  htmlForThisHostID += '<td class="hostid-td-padding">';
  htmlForThisHostID += "<input id=\"first\" type=\"text\" size=\"40\" 
 value=\""+server.name+"\"></input>";

  htmlForThisHostID += "</td>\n";
  htmlForThisHostID += '<td class="hostid-td-padding">';
  htmlForThisHostID += "<input type=\"text\" size=\"6\" value=\" 
  "+server.pin+" \"></input>";

  htmlForThisHostID += "</td>"; 
  htmlForThisHostID += '<td class="hostid-td-padding">';  
  htmlForThisHostID += "<input style=\"width:50px;\" type=\"submit\" 
 value=\"Save\" onclick='Activate(\"" + server.name + "\"," + server.pin + ")'></input>\n";
  htmlForThisHostID += "</td>";

  htmlForThisHostID += "</tr>\n";

  return htmlForThisHostID;
}

Upvotes: 0

Views: 43

Answers (1)

Arleigh Hix
Arleigh Hix

Reputation: 10897

If you are letting the form submit itself with the inputs from your function, then the problem is that you have not set a name attribute for those inputs. Just give them a name.

Unnamed inputs do not get processed see this answer for further details https://stackoverflow.com/a/12543907/6127393

Upvotes: 1

Related Questions