CodeIgniter Forums

Full Version: Search button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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>
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/18318...ent-action

And here's a longer article on how. http://www.techrepublic.com/article/hand...-with-php/

I hope that helps. Good luck!
You can submit the form via JavaScript.