Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
68
rated 0 times [  69] [ 1]  / answers: 1 / hits: 16905  / 9 Years ago, thu, may 28, 2015, 12:00:00

I want to create a Modal Dialog with Bootstrap. I am new in Bootstrap.



how this:



enter



How I can do this and how I get the values from the textfield back.


More From » jquery

 Answers
3

Modal is on the same page. So whatever input field you have inside modal is accessible in your page.



For example you have



<input type=text id=txtName />


You can simply access it using



$(#txtName).val(); 


for Modal code. Here it is done



 <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>&times;</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>




[#66428] Wednesday, May 27, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
estefanib

Total Points: 508
Total Questions: 104
Total Answers: 83

Location: Lebanon
Member since Sun, Aug 2, 2020
4 Years ago
;