Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

How do I pass values to modal without restarting the page?  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an autocomplete search box to search names from DB. Result should be search name, click to open a modal posting the data from php if id is equal. My problem is that when the modal pops-up the page will refresh automatically. How do I stop the page from restarting when the modal form show upon post submit? Seeking your help for this. Thanks alot!

Please refer my codes as noted below:

**HTML** This is an autocomplete searched from livesearch.php


**JS** This should open a modal datas from dsearch_modal.php equal to  id="searchid" of <form class="search" id="searchForm" method="post">


**PHP** dsearch_modal.php


 
Marshal
Posts: 67239
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would cause the automatic page refresh?

And whose .modal() are you using? It's not a native jQuery plugin.
 
mjean elid
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this caused to reload the page upon submit post. But i want the data to get the value of and post in dsearch_modal.php to display info my modal below.



 
Bear Bibeault
Marshal
Posts: 67239
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:And whose .modal() are you using? It's not a native jQuery plugin.

 
mjean elid
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an html bootstrap modal
 
Bear Bibeault
Marshal
Posts: 67239
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you passing a JavaScript statement that submits the form to the .modal() method rather than options as described on this page?
 
Does this tiny ad smell okay to you?
ScroogeXHTML 8.2 - easy to use RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!