Thanks for replying so fast.
ok those lines are the ones I created by modifying the original tep_manufacturers, function which lists manufacturers, my problem is my query works, as it shows
blond and brunette, as a pull down, but when I submit the form, ok here goes the complete form >>>
<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id(); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE_1; ?></td>
<td class="pageHeading" align="right"><?php /*echo tep_image(DIR_WS_IMAGES . 'table_background_browse.gif', HEADING_TITLE_1, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); */?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
if ($messageStack->size('search') > 0) {
?>
<tr>
<td><?php echo $messageStack->output('search'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/corner_left.gif" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading"><?php echo HEADING_SEARCH_CRITERIA; ?></td>
<td height="14" class="infoBoxHeading" nowrap><img src="images/infobox/corner_right.gif" border="0" alt="" width="11" height="14"></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
</tr>
<tr>
<td class="boxText"><?php echo tep_draw_input_field('keywords', '', 'style="width: 100%"'); ?></td>
</tr>
<tr>
<td align="right" class="boxText"><?php echo tep_draw_hidden_field('search_in_description',1); /*tep_draw_checkbox_field('search_in_description', '1') . ' ' . TEXT_SEARCH_IN_DESCRIPTION;*/ ?></td>
</tr>
<tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo '<a href="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_SEARCH_HELP) . '\')">' . TEXT_SEARCH_HELP_LINK . '</a>'; ?></td>
<td class="smallText" align="right"><?php //echo tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH); ?><img src="images/mod_button_left.gif" alt="" border="0">
<input style="padding-top: 2px; padding-bottom: 4px;" class="mod_button_submit" value="Buscar" type="submit" />
<img src="images/mod_button_right.gif" alt="" border="0"></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="fieldKey"><?php echo ENTRY_CATEGORIES; ?></td>
<td class="fieldValue"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))); ?></td>
</tr>
<tr>
<td class="fieldKey"> </td>
<td class="smallText"><?php echo tep_draw_checkbox_field('inc_subcat', '1', true) . ' ' . ENTRY_INCLUDE_SUBCATEGORIES; ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_MANUFACTURERS; ?></td>
<td class="fieldValue"><?php echo tep_draw_pull_down_menu('manufacturers_id', tep_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)))); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<!--New extra fields Inserted here in query-->
<tr>
<td class="fieldKey"><?php echo ENTRY_HAIR; ?></td>//
<td class="fieldValue"><?php echo tep_draw_pull_down_menu('products_to_products_extra_fields_id', tep_get_extra(array(array('id' => '', 'text' => TEXT_ALL_HAIR)))); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_EYES; ?></td>
<td class="fieldValue"><?php echo tep_draw_pull_down_menu('products_to_products_extra_fields_id', tep_get_extra1(array(array('id' => '', 'text' => TEXT_ALL_EYES)))); ?></td>
</tr>
<tr>
<!--End new fields-->
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<!-- Other modifications in other to compare Age and Height entries and check if value FROM is not bigger than value TO etc
All necessary modifications were made to the javascript code based on the way it compares prices and dates -->
<td class="fieldKey"><?php echo ENTRY_AGE_FROM; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('afrom'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_AGE_TO; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('ato'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_HEIGHT_FROM; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('hfrom'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_HEIGHT_TO; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('hto'); ?></td>
</tr>
<!-- Old code for Price commented out as irrelevant /*
<tr>
<td class="fieldKey"><?php//echo ENTRY_PRICE_FROM; ?></td>
<td class="fieldValue"><?php//echo tep_draw_input_field('pfrom'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php// echo ENTRY_PRICE_TO; ?></td>
<td class="fieldValue"><?php// echo tep_draw_input_field('pto'); ?></td>
</tr>
<tr>*/-->
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_DATE_FROM; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('dfrom', DOB_FORMAT_STRING, 'onFocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo ENTRY_DATE_TO; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('dto', DOB_FORMAT_STRING, 'onFocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></form>
Next I modified Advanced Search results, I commented all my mods.
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
$error = false;
if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&
(isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&
(isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&
// $afrom, $hfrom, $ato and $hto added to the code
(isset($HTTP_GET_VARS['afrom']) && !is_numeric($HTTP_GET_VARS['afrom'])) &&
(isset($HTTP_GET_VARS['ato']) && !is_numeric($HTTP_GET_VARS['ato'])) &&
(isset($HTTP_GET_VARS['hfrom']) && !is_numeric($HTTP_GET_VARS['hfrom'])) &&
(isset($HTTP_GET_VARS['hto']) && !is_numeric($HTTP_GET_VARS['hto'])) &&
//end additions
(isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) &&
(isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) {
$error = true;
$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
} else {
$dfrom = '';
$dto = '';
//$afrom, $hfrom, $ato and $hto
$afrom = '';
$ato = '';
$hfrom = '';
$hto = '';
//end additional vars
$pfrom = '';
$pto = '';
$keywords = '';
if (isset($HTTP_GET_VARS['dfrom'])) {
$dfrom = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']);
}
if (isset($HTTP_GET_VARS['dto'])) {
$dto = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']);
}
/* code Added for checking Age and Height*/
if (isset($HTTP_GET_VARS['afrom'])) {
$pfrom = $HTTP_GET_VARS['afrom'];
}
if (isset($HTTP_GET_VARS['ato'])) {
$pto = $HTTP_GET_VARS['ato'];
}
if (isset($HTTP_GET_VARS['hfrom'])) {
$pfrom = $HTTP_GET_VARS['hfrom'];
}
if (isset($HTTP_GET_VARS['hto'])) {
$pto = $HTTP_GET_VARS['hto'];
}
/* End additions*/
if (isset($HTTP_GET_VARS['pfrom'])) {
$pfrom = $HTTP_GET_VARS['pfrom'];
}
if (isset($HTTP_GET_VARS['pto'])) {
$pto = $HTTP_GET_VARS['pto'];
}
if (isset($HTTP_GET_VARS['keywords'])) {
$keywords = $HTTP_GET_VARS['keywords'];
}
$date_check_error = false;
if (tep_not_null($dfrom)) {
if (!tep_checkdate($dfrom, DOB_FORMAT_STRING, $dfrom_array)) {
$error = true;
$date_check_error = true;
$messageStack->add_session('search', ERROR_INVALID_FROM_DATE);
}
}
if (tep_not_null($dto)) {
if (!tep_checkdate($dto, DOB_FORMAT_STRING, $dto_array)) {
$error = true;
$date_check_error = true;
$messageStack->add_session('search', ERROR_INVALID_TO_DATE);
}
}
if (($date_check_error == false) && tep_not_null($dfrom) && tep_not_null($dto)) {
if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) {
$error = true;
$messageStack->add_session('search', ERROR_TO_DATE_LESS_THAN_FROM_DATE);
}
}
//Age Start Checks input and makes sure non numeric values are entered else returns an error
$age_check_error = false;
if (tep_not_null($afrom)) {
if (!settype($afrom, 'double')) {
$error = true;
$age_check_error = true;
$messageStack->add_session('search', ERROR_AGE_FROM_MUST_BE_NUM);
}
}
$height_check_error = false;
if (tep_not_null($ato)) {
if (!settype($afrom, 'double')) {
$error = true;
$age_check_error = true;
$messageStack->add_session('search', ERROR_AGE_TO_MUST_BE_NUM);
}
}
//Age End
//Height Starts using the same parameters as Age
$height_check_error = false;
if (tep_not_null($hfrom)) {
if (!settype($hfrom, 'double')) {
$error = true;
$height_check_error = true;
$messageStack->add_session('search', ERROR_HEIGHT_FROM_MUST_BE_NUM);
}
}
if (tep_not_null($hto)) {
if (!settype($hto, 'double')) {
$error = true;
$height_check_error = true;
$messageStack->add_session('search', ERROR_HEIGHT_TO_MUST_BE_NUM);
}
}
// Height Ends
$price_check_error = false;
if (tep_not_null($pfrom)) {
if (!settype($pfrom, 'double')) {
$error = true;
$price_check_error = true;
$messageStack->add_session('search', ERROR_PRICE_FROM_MUST_BE_NUM);
}
}
if (tep_not_null($pto)) {
if (!settype($pto, 'double')) {
$error = true;
$price_check_error = true;
$messageStack->add_session('search', ERROR_PRICE_TO_MUST_BE_NUM);
}
}
//aGE AND HEIGHT CHECK if they are floting numbers and Age/Height TO is not bigger than FROM
if (($age_check_error == false) && is_float($afrom) && is_float($ato)) {
if ($afrom >= $ato) {
$error = true;
$messageStack->add_session('search', ERROR_AGE_TO_LESS_THAN_AGE_FROM);
}
}
if (($height_check_error == false) && is_float($hfrom) && is_float($hto)) {
if ($hfrom >= $hto) {
$error = true;
$messageStack->add_session('search', ERROR_HEIGHT_TO_LESS_THAN_HEIGHT_FROM);
}
}
//END
if (($price_check_error == false) && is_float($pfrom) && is_float($pto)) {
if ($pfrom >= $pto) {
$error = true;
$messageStack->add_session('search', ERROR_PRICE_TO_LESS_THAN_PRICE_FROM);
}
}
if (tep_not_null($keywords)) {
if (!tep_parse_search_string($keywords, $search_keywords)) {
$error = true;
$messageStack->add_session('search', ERROR_INVALID_KEYWORDS);
}
}
}
//I commented out $ato and $hto because the script returned an error ...
if (empty($dfrom) && empty($dto) //&& empty($afrom) && empty($ato)&& empty($hfrom) && empty(hto)
&& empty($pfrom) && empty($pto) && empty($keywords)) {
$error = true;
$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
}
if ($error == true) {
tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false));
}
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false));
$content = CONTENT_ADVANCED_SEARCH_RESULT;
include (bts_select('main', $content_template)); // BTSv1.5
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
After checking and rechecking all my code I am not able to find out why the function draw form is not passing the values selected in the pulldown function, so please let me know your insight and thanks again for your help.