My form, all fields are properly named and attributed, payload data is all correct when submitting the form data
<td>
<form name='pageform[<%= i %>]' action='/page' method='POST' id='pageform[<%= i %>]' target='_self'>
<input name='phone' id='phone' type='hidden' value='<%= data[key].guest_phone_number %>'>
<input name='readytxt' id='readytxt' type='hidden' value='0'>
<%
var name = data[key].guest_name;
const [first, last] = JSON.stringify(name.toString().split(' '));
%>
<input name='fname' id='fname' type='hidden' value='<%=first %>'>//
<input name='lname' id='lname' type='hidden' value='<%=last %>'>//When I inspect these fields data is first and last name from the split above
</td>
<td style='width:20%;text-align: right;padding:3px'>
<input name='page' formID='pageform' type=submit value=Page onClick="pageftn('<%= data[key].guest_name %>')">
</form></td>
This passes the form data to a server to be used. The custnum and readin variables pass numbers, the name fields obviously text. When inspecting the values of those fields are in fact the first and last names that they should be.
var custnum = +parms.phone;
var readyin = +parms.readytxt;
var firstName = +parms.fname;
var lastName = +parms.lname;
var twilarray = [custnum, readyin, fname, lname];
io.emit('go', twilarray);
\ this outputs socket receive: type "message", data "2["go",[1234567890,0,null,null]]"
My issue on is when the data arrives at the server it arrive [1234567890,0,null,null]
I get that the numbers are being converted to strings and text is an object.
My question is how to get fname and lname to pass the string data they contain