gpt4 book ai didi

javascript - jQuery 克隆表单提交不起作用

转载 作者:行者123 更新时间:2023-11-28 17:48:31 25 4
gpt4 key购买 nike

所以我有一些基本的 html,其中包含一个带有 <form> 的模态框,我将该 html 附加到 <body> 旁边的一个 div 中, 一切都正确显示,只是表单提交不起作用,通过输入或提交按钮不起作用。

$(document).ready(function() {
var windowWidth = (parseInt(window.innerWidth) - 15) + 'px',
windowHeight = $('body').css('height');

$tk = $("#take-survey");
var $html = $tk.css({'width': windowWidth, 'height': windowHeight}).clone();
$tk.remove();
$($html).appendTo(".put-me");
$('body .put-me #take-survey').show();
});

<div id="take-survey" style="width: 1843px; height: 2120px; display: block;">
<div class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
Dear User,<br><br>
Our goal is to provide the best service possible. Please take a 1 minute to complete the following customer service questionnaire. Your comments will enable us to see how we're doing overall and find out how we can improve.<br> It only takes 1 minute!
</div>
<div class="modal-body">





<form name="newSurvey" action="index.php?id=25&amp;L=1&amp;tx_arxsurvey_fesurvey[action]=create&amp;tx_arxsurvey_fesurvey[controller]=Survey" method="post">
<div style="display: none">
<input type="hidden" name="tx_arxsurvey_fesurvey[__referrer][extensionName]" value="ArxSurvey">
<input type="hidden" name="tx_arxsurvey_fesurvey[__referrer][controllerName]" value="Survey">
<input type="hidden" name="tx_arxsurvey_fesurvey[__referrer][actionName]" value="new">
<input type="hidden" name="tx_arxsurvey_fesurvey[__hmac]" value="a:3:{s:9:&quot;newSurvey&quot;;a:4:{s:6:&quot;whyUse&quot;;i:1;s:13:&quot;otherServices&quot;;i:1;s:11:&quot;suggestions&quot;;i:1;s:8:&quot;tellMore&quot;;i:1;}s:6:&quot;action&quot;;i:1;s:10:&quot;controller&quot;;i:1;}77fcb50f86112b3acd1aa7f6eff2b4adeac7a664">
</div>

<label for="userProfile">
What is your user profile? <span class="required">(required)</span>
</label>
<select name="tx_arxsurvey_fesurvey[newSurvey][userProfile]">
<option value="Real Estate Agency">Real Estate Agency</option>
<option value="Real Estate Marketing">Real Estate Marketing</option>
<option value="Floor Drawing Services">Floor Drawing Services</option>
<option value="Project Developers">Project Developers</option>
<option value="Property Management">Property Management</option>
<option value="Interior Design">Interior Design</option>
<option value="Architect">Architect</option>
<option value="Private User">Private User</option>
<option value="Furniture Retailer">Furniture Retailer</option>
</select>
<label>If other please specify:</label>
<input type="text" name="tx_arxsurvey_fesurvey[newSurvey][userProfileOther]">
<label for="useStatus">
How often you use PlanningWiz? <span class="required">(required)</span>
</label>
<div class="hold-radios">
<input type="radio" id="dailyUse" name="tx_arxsurvey_fesurvey[newSurvey][useStatus]" value="Daily">
<label for="dailyUse">Daily</label>
<input type="radio" id="weeklyUse" name="tx_arxsurvey_fesurvey[newSurvey][useStatus]" value="Weekly">
<label for="weeklyUse">Weekly</label>
<input type="radio" id="monthlyUse" name="tx_arxsurvey_fesurvey[newSurvey][useStatus]" value="Monthly">
<label for="monthlyUse">Monthly</label>
<input type="radio" id="rarelyUse" name="tx_arxsurvey_fesurvey[newSurvey][useStatus]" value="Rarely">
<label for="rarelyUse">Rarely</label>
</div>

<label for="whyUse">
Why are you using a room planner? <span class="required">(required)</span>
</label>
<textarea rows="15" cols="40" name="tx_arxsurvey_fesurvey[newSurvey][whyUse]"></textarea>
<label for="otherServices">
Are you using other room planning services as well? If so, why? <span class="required">(required)</span>
</label>
<textarea rows="15" cols="40" name="tx_arxsurvey_fesurvey[newSurvey][otherServices]"></textarea>
<label for="suggestions">
What suggestions for improvement would you have? <span class="required">(required)</span>
</label>
<textarea rows="15" cols="40" name="tx_arxsurvey_fesurvey[newSurvey][suggestions]"></textarea>
<label for="tellMore">
I'd also like to tell you that: <span class="required">(required)</span>
</label>
<textarea rows="15" cols="40" name="tx_arxsurvey_fesurvey[newSurvey][tellMore]"></textarea>

</form></div>
<div class="modal-footer">
<input class="save" type="submit" name="" value="Create new">
<input type="button" value="Skip for now!" class="skip">

</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>

最佳答案

Submit按钮不在表单内,所以关闭 </form>提交按钮后的标签

   <div class="modal-footer">
<input class="save" type="submit" name="" value="Create new">
<input type="button" value="Skip for now!" class="skip">

</div>
</form> // add form close here

关于javascript - jQuery 克隆表单提交不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22778515/

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