How to Fix Form elements do not have associated labels in WordPress Search Form (without button)

Question

Is there any way to fix the “Form elements do not have associated labels” issue in WordPress search form without having the search button.

I want to add a label in the form w/o displaying the search button?

I’m using this code:

<div id="psform"> <?php $search_text = "Search"; ?> <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"> <input type="text" value="<?php echo $search_text; ?>" name="s" id="psf" onblur="if (this.value == '') {this.value = '<?php echo $search_text; ?>';}" onfocus="if (this.value == '<?php echo $search_text; ?>') {this.value = '';}" /> <input type="hidden" id="searchsubmit" /> </form> </div>
0
, Rajesh Patel 3 months 0 Answers 59 views 0

Leave an answer