This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization 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
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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: 67256
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: 67256
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: 67256
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?
 
Evacuate the building! Here, take this tiny ad with you:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!