Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Navigator 6.2 does not reset hidden fields

Status
Not open for further replies.

bobbybobbertson

Programmer
Nov 9, 2001
119
US
I've been programming a site store for my website. I just realized that netscape 6.2 does not reset hidden form fields when the reset button is clicked. IE does reset the hidden fields.

Is this normal for netscape? or is it a recent implementation of 6.2? Has anyone else noticed this?
 
say that i want to use a hidden field to keep a count of a certain number of items that i don't want the user to see. i don't want to use a javascript variable because they don't get submitted. thus, i have to use a hidden form field to get the hidden data to be submitted.

<input type=&quot;hidden&quot; name=&quot;AMOUNT&quot; value=&quot;0&quot;>



i use javascript to update the hidden field with the count.

document.formname.AMOUNT.value++;


now if the user hits reset on the form, all of the visible fields are reset, while my hidden count is not. it screws up my data.




 
Sorry mate,

It was late in the morning and I needed my bed. |-I

The reason I was saying that was I didn`t occur to me that you were using javascript, I assumed because it was posted in the html forum that it was a simple html field with constant value....

I have no idea why this is happening so I guess someone else will have to help you with this one...

Sorry Wullie

 
hi bobbybobbertson,
I just checked your example and admit that you're right - Netscape 6.2 doesn't reset the hidden field value when you click on <input type=&quot;reset&quot;>. It's really amazing, because Opera 6 behaves the same way!

I don't know the reason of this, but it's not a bug for sure (because it is seen in 2 completely different browsers).

My suggestion is to add this to reset button:

<input type=&quot;reset&quot; value=&quot;reset form&quot; onclick=&quot;document.formname.amount.value='0';reset();&quot;>

Now it really resets the hidden value, I checked it. To be more correct, it sets it to a new value that you define.

good luck
 
Just because it's in two different browsers doesn't mean it's not a bug. I'd call it that. If you assign an initial value to a hidden variable in a form and use the reset command, it SHOULD reset the variable to it's initial value. If it doesn't, that's a bug, even if ALL the browsers didn't do it. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top