Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: supernova777 on July 03, 2020, 11:13:33 AM

Title: why doesnt index.php?action=search not focus the textfield onLoad?
Post by: supernova777 on July 03, 2020, 11:13:33 AM
why doesnt index.php?action=search not focus the search input element as the page loads?

this makes no sense.. if i click search i want to type what i want to search for IMMEDIATELY
not click search, have to mouse to the input field, and then type;
especially if im using the search function continuosly

does this not make sense?

<input type="text" name="search" maxlength="100" size="40" class="input_text">

also why does it use name="search" instead of id="search" ???
Title: Re: why doesnt index.php?action=search not focus the textfield onLoad?
Post by: Sir Osis of Liver on July 03, 2020, 12:28:26 PM
I would guess for the same reason loading main index doesn't focus login input field, it doesn't work in all browsers.  I use it for login on my forums because it's convenient for me using FF, and it does no harm in browsers that can't focus the field, it's just ignored.
Title: Re: why doesnt index.php?action=search not focus the textfield onLoad?
Post by: Arantor on July 03, 2020, 12:35:28 PM
Quotealso why does it use name="search"

Because it's an HTML form, it *has* to do that. If you submit a form to the server, elements will be looked up with the *name* to find what to submit. The ID is never submitted to the server. That's literally how HTML forms have worked ever since HTML 2.0.

Quotethis makes no sense.. if i click search i want to type what i want to search for IMMEDIATELY

Disagree. When I do searches and actually go to the search page, invariably I want to put in the boards I care about first.