3 Replies Latest reply on Jul 14, 2014 12:02 PM by Nancy OShea

    search form doesnt work that way

    Marco_ALEX Level 1

      Hi everyone,

      I have this search form on a web site :

      <form role="search" action="/Default.aspx?SiteSearchID=-1&amp;ID=/website/search.htm" method="post" name="catsearchform12869">

                      <input type="text" placeholder="Search. . ." name="CAT_Search" />

                      <em class="icon-search"></em>

                  </form>

       

      you can see it here :http://bc-law-au11.businesscatalyst.com/

       

      wen we search for something we have to press enter key because the search icon does nothing wen we click it.Its just a <em></em>  with the class of the icon,

      how can i change this so that wen we click the icon it submits and redirects to the search results page instead of pressing the enter key?

        • 1. Re: search form doesnt work that way
          Nancy OShea Adobe Community Professional & MVP

          Clicking a background icon won't "DO" anything.  You must include a form submit button to carry out the form's action

           

          <form action="search_script.php" method="GET">

          <input type="search" required title="Type a search word or phrase" class="searchField" placeholder="  Search" name="query" />

          <input type="submit" class="search-button" value="Find" />

          </form>

           

          Nancy O.

          • 2. Re: search form doesnt work that way
            Marco_ALEX Level 1

            Hi Nancy,

            can you give me a hand with a comments BC rating web app form?

             

            here is the code i just accessed in the web apps module templates :

             

            {module_ratingrank}{module_ratingfeedback}</p>

            <p>{module_ratingfeedback}</p>

            <div class="comment-form">

            <h5>Comment</h5>

            <form name="catratingform79281" onsubmit="return checkWholeForm79281(this)" method="post" action="/RatingProcess.aspx?OID={module_oid}&amp;OTYPE={module_otype}">

                <div class="form">

                <div class="item"><label>Was this helpful?</label><br />

                No <input type="radio" name="Rating" value="1" /><input type="radio" name="Rating" value="2" /><input type="radio" name="Rating" checked="checked" value="3" /><input type="radio" name="Rating" value="4" /><input type="radio" name="Rating" value="5" />Very</div>

                <div class="item"><input type="submit" class="cat_button" value="Submit" /></div>

                </div>

                <script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>

                <script type="text/javascript">

            //<![CDATA[

            var submitcount79281 = 0;function checkWholeForm79281(theForm){var why = ""; if(why != ""){alert(why);return false;}if(submitcount77393 == 0){submitcount77393++;theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}

            //]]>

            </script>

            </form>

            </div>

             

            and here is the original code for this webb app:

            ""

            <div class="comment-form"><h3>Comment</h3><form name="catratingform6237" onsubmit="return checkWholeForm6237(this)" method="post" action="/RatingProcess.aspx?OID={module_oid}&OTYPE={module_otype}"><div class="form"><div class="item"><label>Was this helpful?</label><br />No <input type="radio" name="Rating" value="1" /><input type="radio" name="Rating" value="2" /><input type="radio" name="Rating" checked="checked" value="3" /><input type="radio" name="Rating" value="4" /><input type="radio" name="Rating" value="5" />Very</div><div class="item"><label id="RFeedback">Do you have feedback? (Optional)</label><br /><textarea class="comment" name="Feedback" id="RFeedback" cols="10" rows="4"></textarea></div><div class="item"><label id="RFullName">Name (Optional)</label><br /><input class="cat_textbox_small" type="text" name="FullName" id="RFullName" maxlength="255" /></div><div class="item"><label id="RWebsite">Website (Optional)</label><br /><input class="cat_textbox_small" type="text" name="Website" id="RWebsite" maxlength="255" /></div><div class="item"><label id="REmailAddress">Email Address (Optional)</label><br /><input class="cat_textbox_small" type="text" name="EmailAddress" id="REmailAddress" maxlength="255" /></div><div class="item"><label>Enter Word Verification in box below &bull;</label><br />{module_captchav2}</div><div class="item"><input class="cat_button" type="submit" value="Submit" /></div></div><script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script><script type="text/javascript">

            //<![CDATA[

            function checkWholeForm6237(theForm){var why = "";if (theForm.EmailAddress) if (theForm.EmailAddress.value.length > 0) why += checkEmail(theForm.EmailAddress.value);if (theForm.CaptchaV2) why += captchaIsInvalid(theForm, "Enter Word Verification in box below", "Please enter the correct Word Verification as seen in the image"); if (why != ""){alert(why);return false;}theForm.submit();return false;}

            //]]>

            </script></form></div>""

             

            I supose someone tried to remove the fields of optional name, email adress, recaptcha etc, and then the form didnt work ,

            how can i do it, remove all the fields and just leave the "was this helpful" radio buttons and the submit button"?

             

            its on  htis page at:124 YES

            • 3. Re: search form doesnt work that way
              Nancy OShea Adobe Community Professional & MVP

              I have ZERO experience with BC modules.  You'll get better answers to your BC questions from the Business Catalyst Forum.

              Business Catalyst

               

               

              Nancy O.