首先,我是一个 JS 新手。我有 form1 询问我正在序列化的用户电子邮件地址。我需要的是获取这个单一的数据字段并将其反序列化到一个更复杂的表单2中的字段中,当用户提交表单1时,该表单在灯箱中生成。
我已经完成了序列化,也完成了灯箱,但我不知道如何获取在 form1 中提交的电子邮件地址并使用该数据预先填充 form2 中的电子邮件字段。任何帮助,将不胜感激。
两种形式的代码如下。(省略灯箱,因为它不适用)。基本上,我需要将'form1'中的'email'放入'form2'中的'email'字段
<form action="#" id="form1">
<label>email:</label> <input type="text" name="email" id="email"/>
<input type="submit" value="send" name="submit" />
</form>
<form action="#" id="form2">
<label>Email:</label> <input type="text" name="email" id="email"/>
<label>Zip Code:</label> <input type="text" name="zip" id="zip"/>
<strong>Choose a Newsletter </strong>
<ul><li><input type="checkbox" value="2" name="Weekly" id="Weekly"><label>Weekly</label></li>
<li><input type="checkbox" value="4" name="Daily" id="Daily"><label>Daily</label></li>
<li><input type="checkbox" value="8" name="Monthly" id="Monthly"><label>Monthly</label></li>
</ul>
<input type="submit" value="Subscribe" name="Subscribe" />
</form>