Just need a small help with my HTML form, I have the following code:
<form method="get" action="http://solutions-demo.cust-mta.com/automated/action.jsp">
<input type="hidden" name="action" value="updateRecipientNoMsg" />
<input type="hidden" name="redirect_err" value="/automated/action.jsp" />
<input type="hidden" name="redirect_ok" value="http://thankyou.html" />
<input type="hidden" id="gid" name="gid" value="200030053" />
<input type="hidden" id="pmobilenum" name="pmobilenum" value="123456789" />
<input type="hidden" id="uemail" name="uemail" value="[executor]" />
<input type="hidden" id="psw" name="psw" value="password" />
<input type="hidden" id="pemail" name="pemail" value="[emailBeingUpdated]" />
<table border="0">
<tr>
<td width="100"><div align="left"><font color="#ffffff" face="Arial, sans serif" style="font-size:12px;line-height:14px;">Email</font></div></td>
<td width="140"><div align="left"><font face="Arial, sans serif" color="#ffffff" style="font-size:12px;line-height:14px;">
<input type="text" name="pemail" />
</font></div></td>
</tr>
</table>
<table border="0">
<tr>
<td width="100"><div align="left"><font color="#ffffff" face="Arial, sans serif" style="font-size:12px;line-height:14px;">Mobile Number</font></div></td>
<td width="140"><div align="left"><font face="Arial, sans serif" color="#666666" style="font-size:12px;line-height:14px;">
<input type="text" name="pmobilenum" />
</font></div></td>
</tr>
</table>
<table>
<tr>
<td align="center">
<input type="submit" name="Submit" />
</td>
</tr>
</table>
</form>
It is all working correctly, I am contacting a REST API and pushing an action, that being updating a users mobile number using email identifier.
At the moment I just have it all set so when you click it happens and the number is updated in a system.
But I want the user to be able to input their email and their number and it be for them, as currently for testing I have set it to a specific email so whatever details you put in it always updates the hard coded one.
How would I use Javascript to place the values from Mobile Number and Email into here:
<input type="hidden" id="pmobilenum" name="pmobilenum" value="INSERT TEXT FROM MOBILE NUMBER TEXT BOX" />
<input type="hidden" id="pemail" name="pmobilenum" value="INSERT TEXT FROM EMAIL TEXT BOX" />
Should Use getElementByID method and turn this into a JSP page?
Thanks for the advice in advance!
The server doesn’t care if it’s a hidden or a text input, so why not cut out the middleman and get rid of the hidden fields? You already have equivalent text fields for the same
names so it should work just the same.