Mark1 Posted June 13, 2014 at 09:23 AM Share Posted June 13, 2014 at 09:23 AM I need to prevent anyone performing a search using the advanced_search_map module from returning all results if no address is entered. This is a 2.4 site that I have just upgraded from 2.3, where I used to use this Javascript to alert the visitor to enter a value: {jr_postcode} <button onclick="if(jQuery('#jr_postcode').val()==''){alert('Sorry, you must enter a postcode or town to perform a search'); return false;} else jQuery(this).parents('form:eq(0)').attr('action',s2AjaxUri).submit();" class="jrButton"><?php __t("Search");?></button> Here is the HTML section from the from my newly updated theme file: /********************************************************************************** * EDIT HTML BELOW THIS LINE **********************************************************************************/?> <div class="jr-page jrPage jrAdvSearchModule jrRoundedPanel jrForm"> <form class="jr-form-adv-search-module" action="<?php echo cmsFramework::getCurrentUrl();?>" method="post" data-module-id="<?php echo $module_id;?>"> <moduletheme> <div class="jrFieldDiv jrLeft"> <?php __t("Address, Town or Postcode");?>: {jr_postcode}<br> <strong>Enter your location</strong> </div> <div class="jrFieldDiv jrLeft"> <button class="jr-search jrButton" style="margin:0;"> <span class="jrIconSearch"></span><span><?php __t("Search");?></span> </button> </div> </moduletheme> <div class="jrClear"></div> <?php /********************************************************************************** * EDIT HTML ABOVE THIS LINE **********************************************************************************/?> I've tried various methods, but none have worked. Please can you tell me how I can get the warning screen to work again? Link to comment
Kristian Posted June 13, 2014 at 11:19 AM Share Posted June 13, 2014 at 11:19 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Steven Koontz Posted June 13, 2014 at 10:01 PM Share Posted June 13, 2014 at 10:01 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Kristian Posted June 14, 2014 at 07:40 AM Share Posted June 14, 2014 at 07:40 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Mark1 Posted June 14, 2014 at 10:28 AM Author Share Posted June 14, 2014 at 10:28 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Steven Koontz Posted June 14, 2014 at 02:14 PM Share Posted June 14, 2014 at 02:14 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Recommended Posts