jquery - Popup window needed when click on save post in php/JavaScript -


i learning php/javascript , need help: html , php coding :

<h1>itemsaresh1t v<?= itemsaresh1t_version ?></h1> <form method="post"> <input type="checkbox" name="dorun" value="run" <?=     isset($settings['dorun']) ? 'checked' : ''; ?>>&nbsp;run<br> codes of items: separate | - ie. ajk|c1k|d01<br><textarea name="giftcodes" cols="50"><?     = $settings['giftcodes']; ?></textarea><br/> <input type="submit" name="save" value="save settings"> </form>   <form id="frmsearch" method="post" name="form_search"  onsubmit="xmlhttppost('index.php', 'form_search', 'searchresults', '', '<img  src=\'img/indicator.white_1.gif\'>'); return false;">  <input type="hidden" name="formtype" value="search"> <b>search:</b>&nbsp; <input type="text" size=10 name="search">&nbsp;  <select name="type"> <option value="any">any</option> <option value="animal">animal</option> <option value="tree">tree</option> <option value="building">building</option> <option value="decoration">ring/deco</option> <option value="vehicle">vehicle</option> </select> <input type="hidden" name="userid" value="<?= $_session['userid']; ?>"> <input type="submit" name="submit" value="search"></form> </div> <div id="searchresults"></div> 

and using javascript clear search result :

<script type="text/javascript" src="/js/ajaxsbmt.js"></script> <script type="text/javascript">     function clearsearch(id){         obj = document.getelementbyid(id);         obj.innerhtml = "";      }   </script> 

in php clear search results :

    echo '<a href="#" onclick="clearsearch(\'searchresults\');">clear search results</a>'; #on click clear result 


here want search result in popup window table design ...

firstly, might want check out ajax (snippet related post) send data server, process , send response browser. pure js:

<script type="text/javascript"> function loadxmldoc() {     var xmlhttp;      if (window.xmlhttprequest) {         // code ie7+, firefox, chrome, opera, safari         xmlhttp = new xmlhttprequest();     } else {         // code ie6, ie5         xmlhttp = new activexobject("microsoft.xmlhttp");     }      xmlhttp.onreadystatechange = function() {         if (xmlhttp.readystate == xmlhttprequest.done ) {            if(xmlhttp.status == 200){                document.getelementbyid("mydiv").innerhtml = xmlhttp.responsetext;            }            else if(xmlhttp.status == 400) {               alert('there error 400')            }            else {                alert('something else other 200 returned')            }         }     }      xmlhttp.open("get", "ajax_info.txt", true);     xmlhttp.send(); } </script> 

secondly, technique called modal or dialog window - looks alert window (js) html (write whatever want here - table, style it, add js, etc.). there various ways it, name some:

  1. bootstrap - http://getbootstrap.com/javascript/#modals
  2. jquery - https://jqueryui.com/dialog/

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -