gpt4 book ai didi

javascript - 如何在html页面的表单中设置选定的选项?

转载 作者:行者123 更新时间:2023-11-28 00:40:25 24 4
gpt4 key购买 nike

我必须将所选选项从index.html页面传递到form.html。现在,在此表单中,将有一个字段必须与在index.html 页面中选择的字段相同。我将如何做到这一点?

index.html

<div class="form-group col-md-6 col-sm-6">
<label for="">Search By Services</label>
<select class="form-control selectpicker">
<option>Carpenter</option>
<option>Mobile SIM services</option>
</select>
</div>

form.html

   <div class="form-group">
<label class="col-lg-3 control-label">City:</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="city" value="Bangalore" name="" placeholder="" readonly="readonly">
</div>
</div>

最佳答案

从第一个表单中获取值,最好通过使用 session 的服务器端语言将其“POST”或“GET”到服务器,并以其他形式使用它。

关于javascript - 如何在html页面的表单中设置选定的选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28007919/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com