0

I have a view named search-form. In my view there are some fields like age, profession, education, etc. In this view I am using 2 buttons i.e. Submit & Reset. These buttons show from Exposed Form setting of View.

Submit button is working fine but whenever I click on the Reset button. It works like submit button. I have check through firebug. Found this <input type="submit" id="edit-reset" name="op" value="Reset" class="form-submit">. I think in place of 'submit', 'reset' need to set. How can I solve this. Please help. Thanks.

2 Answers 2

1

Try this:

Use str_replace() function

$variables['page']=str_replace(your replace code); in your template.php within themename_preprocess_html() fuction.

You can replace type="submit" with what you want i.e type="reset".

Rough Example

$variables['page']=str_replace('<input type="submit" id="edit-reset" name="op" value="Reset" class="form-submit">','<input type="reset" id="edit-reset" name="op" value="Reset" class="form-submit">',$variables['page']);
0
3

Download and install the Better Exposed Filters module. This module provides a "Include Reset button" when you are creating a View. Hope that helps.

5
  • Thanks for your reply. Actually this issue occurs in my live site & client don't want to use any module.
    – Nishant
    Oct 31, 2014 at 6:26
  • Ok. Please refer this article zyxware.com/articles/3335/… Tell me if it helps you.
    – echo
    Oct 31, 2014 at 6:29
  • same issue with this module also. I think something went wrong.
    – Nishant
    Oct 31, 2014 at 6:52
  • Have you tried writing custom code as explained in above mentioned link ?
    – echo
    Oct 31, 2014 at 7:00
  • No I can't try to create new custom module any more.
    – Nishant
    Oct 31, 2014 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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