entfred@hotmail.com wrote:
Quote:
I was experimenting with trying to select the same item in a select box
twice in a row
and found out that you need to do a refresh (view - refresh) in
Internet Explorer. This is
so you can click on the same item twice "in a row" to select it.
That approach has serious usability issues as described by bobzimuta.
It is generally a bad idea to use onchange with a select for anything,
or to use onchange on any form control to submit a form.
However, to address the other parts of your question...
Quote:
Does anyone know how to automatically make a web page do a refresh when
the web
page loads? This would prevent the user from having to do the refresh,
themselves.
You can use window.onload to reset the form.
Quote:
An example select box would be
>
<select name="colors" onChange="form1.submit();">
Using the form name this way is not a good idea. If the select is a
control of form1, use:
<select ... onchange="this.form.submit();">
Otherwise use:
<select ... onchange="document.forms['form1'].submit();">
The way you have used it 'works', but it is easy to break.
Quote:
<option value="red">red</option><option
value="blue">blue</option><option value="green">green</option><option
value="purple">purple</option>
</select>
>
A typical scenario:
>
1. The user clicks on blue
Given that red is the first option (and probably the default selected),
selecting it won't fire the onchange handler. Given your scenario, the
first option must be blank or other invalid selection to force the user
to change it and fire the onchange handler. As a result, you can't
have a useful default selection, users *must* change the selection. If
you allow the user to select an option, then submit the form, they can
choose any value and you can set a useful default.
Quote:
2. form1 is submitted
If they are using keyboard navigation, IE will submit the form as soon
as they navigate up or down using a cursor key. onchange is supposed
to fire when the control loses focus, IE does it prematurely in this
case.
[...]
The correct way to add a signature is to have two dashes, a space and a
return on a line by themselves. That allows news readers to
automatically trim the signature when quoting.
--
Rob.