SearchSearch   

can't reset a hidden field in form

 
Goto page Previous  1, 2
   Webmaster Forums (Home) -> Javascript RSS
Next:  Ajax call in Javascript to request on same server..  
Author Message
Evertjan.

External


Since: Sep 30, 2005
Posts: 2391



(Msg. 16) Posted: Mon Aug 13, 2007 9:34 am
Post subject: Re: can't reset a hidden field in form
Archived from groups: comp>lang>javascript (more info?)

Evertjan. wrote on 13 aug 2007 in comp.lang.javascript:

> That is what some secification siys it could be names.

Since there is no bug in my keyboard,
it must have been me that wrote that ;-(

I ment:
That is what some specification says it could be named.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Back to top
Evertjan.

External


Since: Sep 30, 2005
Posts: 2391



(Msg. 17) Posted: Mon Aug 13, 2007 11:32 am
Post subject: Re: can't reset a hidden field in form
Archived from groups: per prev. post (more info?)

Randy Webb wrote on 13 aug 2007 in comp.lang.javascript:
>> In short, resetting a hidden formfield value by the html reset
>> function may be according to specs, but is illogical. Misnaming it a
>> "control" dos not influence this logic.
>
> Whether it is illogical or not is a personal opinion.

No matter, I started that it was illogical, but perhaps in specs.

> And no matter
> what that opinion is (mine, yours or anybody else's), the behavior is
> easily worked around and when there is a trivial solution then it
> seems moot to even worry about it.

I think discussing the logic of specifications is a vey good way to
influence later dicisions of "the people that decide".

The W3C people must lack the vision of the simple users, like we are.

An example of logic:
The logic of any core function trying to parse a number string
as octal, [without the specific base number as an explicit parameter]
in this century, escapes me. Backward compatibility has it's limits.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Back to top
dhtmlkitchen

External


Since: Jul 05, 2007
Posts: 41



(Msg. 18) Posted: Mon Aug 13, 2007 9:30 pm
Post subject: Re: can't reset a hidden field in form
Archived from groups: per prev. post (more info?)

On Aug 12, 8:32 pm, RobG <rg....RemoveThis@iinet.net.au> wrote:
> On Aug 13, 8:54 am, Randy Webb <HikksNotAtH....RemoveThis@aol.com> wrote:
>
>
>
> > Evertjan. said the following on 8/12/2007 6:22 PM:
>
> > > newbie wrote on 13 aug 2007 in comp.lang.javascript:
>
> > >> On Aug 12, 2:54 pm, "Evertjan." <exjxw.hannivo....RemoveThis@interxnl.net> wrote:
> > >>> ==============
> > >>> <form>
> > >>> <input type=hidden value='aaa'>
> > >>> <input type=reset>
> > >>> </form>
>
> > >>> <button
> > >>> onclick='alert(document.forms[0].elements[0].value)'>
> > >>> show value</button>
> > >>> <br>
>
> > >>> <button onclick='document.forms[0].elements[0].value="22222"'>
> > >>> set value to 2222</button>
> > >>> ==============
>
> > >>> Works fine here [IE7]
>
> > >> I debugged my code with firefox. Yes, my code works on IE(6/7), but
> > >> the weird thing happens on firefox:(
>
> > > I don't think it is wierd at all.
>
> > > A hidden field that is set to another value than the initial one
> > > by code SHOULD NOT be changed or reset by direct user action.
> > > The user is not ment to influence the hidden field.
>
> > > What would be the use of the "hiddenness" if the user could directly
> > > influence that?
>
> > > Randy Webb wrote on 13 aug 2007 in comp.lang.javascript:
> > >> Works fine in IE7 and Safari3.0 but not in Firefox1.5/2.0 nor Opera9.
>
> > > I think IE7 and Safari3.0 are in error, logically speaking.
> > > Technically it is a question of specification.
>
> > Personally, I think IE7 and Safari are right. The user tells the browser
> > "Reset this form" and that is what the browser does. FF and Opera don't
> > do what the user asked it to do.
>
> I think you're right.
>
> Resetting the form should set all values back to their initial value
> which is set by the value attribute in the HTML. The initial value is
> stored in the DOM defaultValue property, resetting the form should set
> all controls back to the defaultValue.
>
> Resetting a form should set all controls back to their defaultValue.
> I don't see anywhere that programmatically changing the value
> attribute should change the defaultValue property for hidden controls
> only:
>
> <URL:http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26091157>
>
> --
> Rob


Nail on the head. It is a bug.

See my comments:

https://bugzilla.mozilla.org/show_bug.cgi?id=158209

Please vote for this bug!

(if you don't already have a bugzilla account, you'll need to
register. It only takes 2 minutes)

Discussions on the bugzilla bug are discouraged!

Further reading material:

http://www.w3.org/TR/html4/interact/forms.html#h-17.2.1
----------------------------------------------------------------
HTML defines the following control types:
buttons
* submit buttons: <snip>
* reset buttons: When activated, a reset button resets all controls
to their initial values.
* push buttons: <snip>
<snip>
....
checkboxes
radio buttons
menus (The SELECT); the OPTGROUP and OPTION.
text input (INPUT , TEXTAREA)
file select
hidden controls
object controls
----------------------------------------------------------------

Garrett
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> Javascript
Goto page Previous  1, 2
Page 2 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum