This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 67197
169
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: 67197
169
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: 67197
169
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?
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!