Make WordPress Core

Opened 16 years ago

Closed 15 years ago

#5285 closed defect (bug) (invalid)

Problematic markup in searchform widget for styling

Reported by: wolfr's profile Wolfr Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Widgets Keywords:
Focuses: Cc:

Description

This is the markup for the searchform widget:

			<div>
				<input type="text" name="s" id="s" size="15" /><br />
				<input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" />
			</div>

Problems:

  • The line break (br) makes it impossible to style the widgets to have search input
    next to submit, now submit is always underneath the text input
  • The submit button doesn't have a class nor id, so you can't style it.
  • The naming of the input type text's id is quite problematic

Proposed solution:

				<div>
					<input type="text" name="searchinput" class="input-text" size="15" />
					<input type="submit" class="input-submit" value="<?php echo attribute_escape(__('Search')); ?>" />
				</div>

  • logical class names
  • no br element

Change History (3)

#1 @ryan
15 years ago

  • Component changed from Template to Widgets
  • Owner anonymous deleted

#2 @ryan
15 years ago

  • Type changed from task (blessed) to defect (bug)

#3 @Denis-de-Bernardy
15 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

The name=s is needed, and you can now override the callback function in a plugin if you want to change the rest.

Note: See TracTickets for help on using tickets.