Javascript 使用getElementById动态查询

Javascript 使用getElementById动态查询,javascript,Javascript,只需要对我的HTML表单提供一些帮助,我有以下代码: <form method="get" action="http://solutions-demo.cust-mta.com/automated/action.jsp"> <input type="hidden" name="action" value="updateRecipientNoMsg" /> <input type="hidden

只需要对我的HTML表单提供一些帮助,我有以下代码:

<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>

电子邮件
手机号码
这一切都正常工作,我正在联系RESTAPI并推动一项操作,即使用电子邮件标识符更新用户的手机号码

目前,我只是把它全部设置好了,所以当你点击它的时候,系统中的数字就会更新

但我希望用户能够输入他们的电子邮件和他们的号码,这是为他们,因为目前的测试,我已将其设置为一个特定的电子邮件,所以无论你在它的细节总是更新硬编码的一个

如何使用Javascript将手机号码和电子邮件中的值放入此处:

<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" />

应该使用getElementByID方法并将其转换为JSP页面吗


提前谢谢你的建议

服务器不在乎它是隐藏的还是文本输入,所以为什么不删掉中间人,去掉隐藏字段呢?对于相同的
名称
s,您已经有了等效的文本字段,因此它的工作原理应该是一样的