Jump to content

Search Button not Submitting my table!


ASPF430

Recommended Posts

Hi, I edited some PHP code so the layout of a search form looked better, but now, when I push search, any criteria placed is actually submitted.

I.e. Before, the results would show according the rental ranges the user placed and display the correct properties. AFTER editing, it just displays every property, no matter what!

 

If anyone could help me, I would appreciate it so much - I have hardly no PHP knowledge! I really appreciate your time.

 

The code is below...anyone know how to fix it?

 

N.B. Its the first table with Min Bedrooms, Min Price and Max Price! (ignore advance search)

 

 

 

 

 

 

<?php // no direct access
defined('_JEXEC') or die('Restricted access');

JHTML::stylesheet('jea.css', 'media/com_jea/css/');

$use_ajax = $this->params->get('use_ajax', 0);

if ($use_ajax ) {
JHTML::script('search.js', 'media/com_jea/js/', true);

$document =& JFactory::getDocument();

//initialize the form when the page load
$document->addScriptDeclaration("
	window.addEvent('domready', function() {
		refreshForm(); 
	});");
}

?>



<form action="<?php echo JRoute::_('&task=search&layout=default') ?>" method="post" id="jea_search_form" enctype="application/x-www-form-urlencoded" >

<fieldset><legend><?php echo JText::_('Quick search') ?></legend>
<p>
    <input type="radio" name="cat" id="renting" value="renting" checked="checked" <?php echo $use_ajax ? 'onclick="refreshForm()"' : '' ?> >
    <strong><label for="renting"><?php echo JText::_('I am looking to rent a Property') ?></label>
    </strong> </p>
    
<?php if ( $use_ajax ): ?>
    </fieldset>
  <fieldset>
  <div align="left"></div>
  </fieldset>
  
  <div align="left">
      <fieldset>
      <strong>
      </strong>
      </fieldset>
      <fieldset>
      <strong>
      </strong>      
      <table width="520" border="0">
        <tr>
          <td width="272"><strong>Minimum Number of Bedrooms </strong> </td>
          <td width="238"><strong>
            <select name="select" >
              <option value="1" selected>1 Bedroom/Studio</option>
              <option value="2">2 Bedroom</option>
              <option value="3">3 Bedroom</option>
              <option value="4">4 Bedroom</option>
              <option value="5">5 Bedroom</option>
            </select>
          </strong></td>
        </tr>
        <tr>
          <td><strong>Minimum Rent Per Calender Month </strong></td>
          <td><strong>
            <select name="select2" >
              <option selected>No Minimum</option>
              <option value="400">£400pcm</option>
              <option value="500">£500pcm</option>
              <option value="600">£600pcm</option>
              <option value="700">£700pcm</option>
              <option value="800">£800pcm</option>
              <option value="900">£900pcm</option>
              <option value="1000">£1000pcm</option>
              <option value="1200">£1200pcm</option>
              <option value="1500">£1500+</option>
            </select>
          </strong></td>
        </tr>
        <tr>
          <td><strong>Maximum Rent Per Calender Month </strong></td>
          <td><select name="select3" >
            <option selected>No Maximum</option>
            <option value="400">£400pcm</option>
            <option value="500">£500pcm</option>
            <option value="600">£600pcm</option>
            <option value="700">£700pcm</option>
            <option value="800">£800pcm</option>
            <option value="900">£900pcm</option>
            <option value="1000">£1000pcm</option>
            <option value="1200">£1200pcm</option>
            <option value="1500">£Over 1500pcm</option>
          </select></td>
        </tr>
      </table>     
      </fieldset>
  </div>
  <fieldset>
  </fieldset>
  <fieldset>
  </fieldset>
  	<fieldset>
  	<?php else: ?> 

   	<p>
<?php echo $this->getHtmlList('types', '--'.JText::_( 'Property type' ).'--', 'type_id' ) ?>
<?php echo $this->getHtmlList('departments', '--'.JText::_( 'Department' ).'--', 'department_id' ) ?>
  	<?php echo $this->getHtmlList('towns', '--'.JText::_( 'Town' ).'--', 'town_id' ) ?>
  	</p>
   	<?php endif ?>
  	
  	</fieldset>
  	<p><input type="submit" class="button" value="<?php echo JText::_('Search') ?>" /></p>
  	
<?php if ( $this->params->get('advanced_search', 0)): ?>
  	
  	<fieldset><legend><?php echo JText::_('Advanced search') ?></legend>
  	
  	<table>
  		<tr>
  			<td class="jea_label"><label for="budget_min"><?php echo JText::_('Budget min') ?> : </label></td>
  			<td><input id="budget_min" type="text" name="budget_min" size="5" /> <?php echo $this->params->get('currency_symbol', '€') ?></td>
  			<td class="jea_label"><label for="budget_max"><?php echo JText::_('Budget max') ?> : </label></td>
  			<td><input id="budget_max" type="text" name="budget_max" size="5" /> <?php echo $this->params->get('currency_symbol', '€') ?></td>
  		</tr>
  		<tr>
  			<td class="jea_label"><label for="living_space_min"><?php echo JText::_('Living space min') ?> : </label></td>
  			<td><input id="living_space_min" type="text" name="living_space_min" size="5" /> <?php echo $this->params->get( 'surface_measure' ) ?></td>
  			<td class="jea_label"><label for="living_space_max"><?php echo JText::_('Living space max') ?> : </label></td>
  			<td><input id="living_space_max" type="text" name="living_space_max" size="5" /> <?php echo $this->params->get( 'surface_measure' ) ?></td>
  		</tr>
  	</table>
  	<p><?php echo JText::_('Minimum number of rooms') ?>  : <input type="text" name="rooms_min" size="1" /></p>
  	
  	<p><?php echo JText::_('Advantages') ?> : <br />
  	<?php echo $this->getAdvantages('', 'checkbox') ?>
  	</p>	
  	</fieldset>
  	
  	<p><input type="submit" class="button" value="<?php echo JText::_('Search') ?>" /></p>
  	
<?php endif ?>
    
    <div>
    <input type="hidden" name="Itemid" value="<?php echo JRequest::getInt('Itemid', 0) ?>" />
    <?php echo JHTML::_( 'form.token' ) ?>
    </div>
  
</form>

 

 

Link to comment
Share on other sites

You most likely messed up something on accident while trying to edit it. It would be a good idea to either post the original (unedited source) or to just try to reedit being more careful, because I doubt anyone is going to watch to search through all that code and try to find the differences.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.