0

I am new to Magento so forgive me if I'm missing something obvious...

I have the standard advanced search form, and 2 mail forms made with the Form Builder extension. None of these forms submit. You click the submit button and nothing at all seems to happen. Anyone know why this might be?

This is the search I put on my home page, which is basically the same as the normal advanced search block except that I've moved the button up into the ul for layout reasons, and changed the form action as per these instructions.

<?php $maxQueryLength= $this->helper('catalogsearch')->getMaxQueryLength();?> <?php echo $this->getMessagesBlock()->toHtml() ?> <form action="<?php echo $this->getSearchPostUrl() ?>" method="get" id="form-validate">
    <div class="fieldset advanced-search">
        <ul class="form-list" id="advanced-search-list">
            <?php foreach ($this->getSearchableAttributes() as $_attribute): ?>
            <?php $_code = $_attribute->getAttributeCode() ?>
            <li>
                <label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label>
                <?php switch($this->getAttributeInputType($_attribute)):
                    case 'number': ?>
                    <div class="input-range">
                        <input type="text" name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" />
                        <span class="separator">-</span>
                        <input type="text" name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" />
                    </div>
                    <?php break;
                    case 'price': ?>
                    <div class="input-range">
                        <input name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>"  class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" />
                        <span class="separator">-</span>
                        <input name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>"  class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" />
                        <small>(<?php echo $this->getCurrency($_attribute); ?>)</small>
                    </div>
                    <?php break;
                    case 'select': ?>
                        <div class="input-box">
                            <?php echo $this->getAttributeSelectElement($_attribute) ?>
                        </div>
                    <?php break;
                    case 'yesno': ?>
                        <?php echo $this->getAttributeYesNoElement($_attribute) ?>
                    <?php break;
                    case 'date': ?>
                    <div class="input-range">
                        <?php echo $this->getDateInput($_attribute, 'from') ?>
                        <span class="separator">-</span>
                        <?php echo $this->getDateInput($_attribute, 'to') ?>
                    </div>
                    <?php break;
                    default: ?>
                    <div class="input-box">
                        <input type="text" name="<?php echo $_code ?>" id="<?php echo $_code ?>" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute)) ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>"  class="input-text <?php echo $this->getAttributeValidationClass($_attribute) ?>" maxlength="<?php echo $maxQueryLength;?>" />
                    </div>
                <?php endswitch; ?>
            </li>
            <?php endforeach; ?>
            <li class="buttons-set">
              <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Search')) ?>" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button>
            </li>

        </ul>
        <script type="text/javascript">decorateList('advanced-search-list')</script>
    </div> </form> <script type="text/javascript"> //<![CDATA[
    var dataForm = new VarienForm('form-validate', true); //]]> </script>
2
  • Paste the code of the forms. – Anshu Mishra Jul 2 '16 at 4:00
  • Share you form code Or site link ? – Abdul Jul 2 '16 at 4:42
0

Try this code

<?php $maxQueryLength= $this->helper('catalogsearch')->getMaxQueryLength();?>
<?php echo $this->getMessagesBlock()->toHtml() ?>
<form action="<?php echo $this->getUrl('catalogsearch/advanced/result') ?>" method="get" id="advanced-form-validate">
    <div class="fieldset advanced-search">
        <h2 class="legend"><?php echo $this->__('Search Settings') ?></h2>
        <ul class="form-list" id="advanced-search-list">
            <?php foreach ($this->getSearchableAttributes() as $_attribute): ?>
            <?php $_code = $_attribute->getAttributeCode() ?>
            <li>
                <label for="<?php echo $_code ?>"><?php echo $this->getAttributeLabel($_attribute) ?></label>
                <?php switch($this->getAttributeInputType($_attribute)):
                    case 'number': ?>
                    <div class="input-range">
                        <input type="text" name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" />
                        <span class="separator">-</span>
                        <input type="text" name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" />
                    </div>
                    <?php break;
                    case 'price': ?>
                    <div class="input-range">
                        <input name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>"  class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" />
                        <span class="separator">-</span>
                        <input name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>"  class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" />
                        <small>(<?php echo $this->getCurrency($_attribute); ?>)</small>
                    </div>
                    <?php break;
                    case 'select': ?>
                        <div class="input-box">
                            <?php echo $this->getAttributeSelectElement($_attribute) ?>
                        </div>
                    <?php break;
                    case 'yesno': ?>
                        <?php echo $this->getAttributeYesNoElement($_attribute) ?>
                    <?php break;
                    case 'date': ?>
                    <div class="input-range">
                        <?php echo $this->getDateInput($_attribute, 'from') ?>
                        <span class="separator">-</span>
                        <?php echo $this->getDateInput($_attribute, 'to') ?>
                    </div>
                    <?php break;
                    default: ?>
                    <div class="input-box">
                        <input type="text" name="<?php echo $_code ?>" id="<?php echo $_code ?>" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute)) ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>"  class="input-text <?php echo $this->getAttributeValidationClass($_attribute) ?>" maxlength="<?php echo $maxQueryLength;?>" />
                    </div>
                <?php endswitch; ?>
            </li>
            <?php endforeach; ?>
        </ul>
        <script type="text/javascript">decorateList('advanced-search-list')</script>
    </div>
    <div class="buttons-set">
        <button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button>
    </div>
</form>
<script type="text/javascript">
//<![CDATA[
    var dataForm = new VarienForm('advanced-form-validate', true);
//]]>
</script>
1
  • Ok great thank you that works. Do you know how I might fix the form builder mail forms? – user500665 Jul 2 '16 at 11:00
0

Partial answer by Abdul above. My problem turned out to be because of a conflict with my jquery and the built in protoytpe. Setting up jQuery.noConflict() resolved the no-submit issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.