Welcome Guest, Not a member yet? Register   Sign In
Form Help question...
#1

[eluser]Jbeasley6651[/eluser]
I am using ci's form helper.

I am making a search on my site and i have a search box on the home page and then the same search box on the results page. (for the ability to refine the search)

What is the BEST way to pass this information from one form to the other?

Search box code

Code:
<?=form_open('search/results',array('id' => 'searchForm'))?>
<p>
<label>Bedrooms</label>
&lt;?php echo form_dropdown('beds', $numop);?&gt;
</p>
<p>
<label>Bathrooms</label>
&lt;?php echo form_dropdown('baths', $numop); ?&gt;</p>
<p>
<p>
<label>Price Minimum</label>
&lt;?php echo form_dropdown('price_min', $prices, '50000'); ?&gt;</p>    
<p>
<p>
<label>Price Max</label>
&lt;?php echo form_dropdown('price_max', $prices, '2500000'); ?&gt;</p>
<p>
<p>
    <label>MLS ID</label>
    &lt;input type="text" name="mlsid" value="" size="50" /&gt;
</p>
<p>
    <label>City</label>
    &lt;input type="text" name="city" value="" size="50" /&gt;
</p>
<p>
    &lt;input type="submit" value="Submit" class="btn" /&gt;
</p>
&lt;/form&gt;

Thanks in advanced.

~ Jbeasley
#2

[eluser]Krzemo[/eluser]
I hope I got it right.
Checking for post data in search result controller and populating search box on search results page with it should do the thing.

Regards
#3

[eluser]Thorpe Obazee[/eluser]
You can use the form_validation set_value() assuming you used it
#4

[eluser]Jbeasley6651[/eluser]
i figured it out, i can just use $_POST['data']; in the form echo on the results page

Code:
&lt;?php echo form_dropdown('price_max', $prices, $_POST['price_max']); ?&gt;</p>




Theme © iAndrew 2016 - Forum software by © MyBB