These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:03 pm Advanced search

INPUT TYPE=RESET for a single INPUT

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

INPUT TYPE=RESET for a single INPUT

Postby antoniomochi » Fri Jun 29, 2012 5:30 pm

<INPUT TYPE=RESET> is one of the most annoying these days. Hardly anyone wants to delete the data from all fields of a form, but usually only one or another field, which forces us to use javascript.
I don't know a way in HTML to clear a field among several in a form that is not by scripts.
One suggestion to solve this is adding the FOR="id" attribute (as in LABEL element) within the element INPUT TYPE=RESET in order to remove only the information from a single field.

On this exemple, the reset button only clear the filter input:
Product: <input type="text" name="product" id="product" /><br />
Search Filter: <input type="text" name="filter" id="filter" />
<input type="reset" for="filter" value="X"><br />
<input type="submit" value="Submit">
User avatar
antoniomochi
<h6>
 
Posts: 1
Joined: Fri Jun 29, 2012 3:31 pm
Location: Brazil.

Re: INPUT TYPE=RESET for a single INPUT

Postby zcorpan » Mon Sep 10, 2012 8:25 am

Isn't it better to let the browser provide a convenient way for the user to clear the field? A separate button might not be especially convenient for the user, e.g. on a touch device with on-screen keyboard, the user would have to remove focus from the filter field and click on your X button and then go back to the filter field. The browser can provide an X button in the on-screen keyboard so the user doesn't have to close the keyboard to clear the field.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest