CodeIgniter Forums
Search button - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Search button (/showthread.php?tid=629)



Search button - jaysondotp - 12-28-2014

Hi coders,



it is possible to search from db that the button search is out of form? ex. below

Code:
<form action="search_found" id="form" method="post" name="form">

    <img id="close" src="<?php echo base_url();?>img/close.png" onclick ="div_hide()">
    <br/>
    <p>Search Found <span class = "glyphicon glyphicon-share-alt"></span></p>
    <br/>
    <input class="form-control" name="name" placeholder="Barcode" type="text"><br/>
    <input class="form-control" name="email" placeholder="Description" type="text"><br/>
    <p>Old Price</p>
    <input class="form-control" name="email" placeholder="Cost" type="text"><br/>
    <input class="form-control" name="email" placeholder="Cash" type="text"><br/>
    <input class="form-control" name="email" placeholder="Card" type="text"><br/>
    <p>Promo Price</p>
    <input class="form-control" name="email" placeholder="Cost" type="text"><br/>
    <input class="form-control" name="email" placeholder="SRP" type="text"><br/>
    <a href="javascript:%20check_empty()" id="submit">Save</a>
</form>

<input type="text" name = "barcode_found" class="form-control"  placeholder="Barcode" autofocus style = "width:229px;>
<button type="submit" class="btn btn-xlarge btn-primary"  id="popup" onclick="div_show()"> Search </button>



RE: Search button - RobertSF - 12-30-2014

If I remember correctly, no. When you click the button, nothing will happen because the form won't post. But you can have two or more submit buttons in your form.

Here's a short answer on how. http://stackoverflow.com/questions/18318678/how-to-include-two-submit-buttons-for-a-form-with-different-action

And here's a longer article on how. http://www.techrepublic.com/article/handling-multiple-submits-in-a-single-form-with-php/

I hope that helps. Good luck!


RE: Search button - includebeer - 12-30-2014

You can submit the form via JavaScript.