0
A
回答
2
Modal在同一頁上。因此,無論您在頁面中訪問模態內的任何輸入字段。
例如,你有
<input type="text" id="txtName" />
可以使用
$("#txtName").val();
模態代碼,只需訪問它。這是做
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<input type="text" id="txtname">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
-1
嘗試這個辦法:從下拉列表
var name = $('#txtname').val();
訪問值:
你會碰到這樣的:
var plantid = $('.drpplants').get(0).value;
或者
var plantid = $('.drpplants').get(1).value;
相關問題
- 1. 模態對話框 - 返回值並非總是返回
- 2. 如何從Cocoa對話框創建並獲取返回值?
- 3. MVC3返回值到模態對話框
- 4. 從Activity對話框獲取返回值
- 5. 如何從jQueryMobile對話框中獲取返回值?
- 6. PyQt自定義對話框 - 如何獲取返回值?
- 7. 使用htmlunit如何獲取模態對話框元素
- 8. 從模態對話框返回時間時,關閉對話框
- 9. 如何在運行時創建對話框並獲取返回值?
- 10. 如何用單選按鈕創建對話框並返回值
- 11. Bootstrap 3模態對話框和流星
- 12. React-Bootstrap全屏模態對話框
- 13. wxPython的:從對話框獲取值,並且使用它的對話框類
- 14. 模式對話框:始終使用MSCRMs返回值openstddlg()方法
- 15. JOptionpane + JDialog(非模態)獲取返回值
- 16. 如何在回發後從jQuery模式對話框中獲取文本框值?
- 17. 獲取模態對話框回覆輸入
- 18. 如何獲取IBInspectable var值並返回?
- 19. Android在對話框中獲取EditText值[空字符串返回]
- 20. 如何使用PowerShell在Internet Explorer中刮取模態對話框
- 21. 如何使用__cyg_profile_func_exit獲取返回值?
- 22. JQuery:從已提交的模態對話框中獲取值
- 23. 對話框獲取值
- 24. 獲取對話框的值
- 25. 從pygame應用程序調用wx對話框並返回值
- 26. 運行jQuery模態對話框如果PHP返回0
- 27. 如何使用MVVM從WPF對話框中獲取值
- 28. 如何使用PyQt在對話框中獲取多個值
- 29. 獲取angular-bootstrap模態使用angular-1.3
- 30. 更改jquery + bootstrap模態對話框div到BootStrap + angularjs
的最佳方式將是開始閱讀的文檔[引導情態動詞(http://getbootstrap.com/javascript/#modals)。你使用的是ASP.NET還是PHP? – Mivaweb
我想用javascript – Tarasov