The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> JavaScript Development
|
NS6 - DHTML (display: none) - form submission - fields not passed
Discuss NS6 - DHTML (display: none) - form submission - fields not passed in the JavaScript Development forum on Dev Shed. NS6 - DHTML (display: none) - form submission - fields not passed JavaScript Development forum discussing JavaScript and DHTML, AJAX, and issues such as coding cross-browser JavaScript.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 8th, 2001, 03:12 PM
|
|
Junior Member
|
|
Join Date: Dec 2000
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
i have a form.
a table resides in the form.
the table consists of 3 rows (a unique ID is assigned to each row) with a total cell count 3 (i.e., 1 cell per row).
one field resides in each cell.
above the table are three hyperlinks that control display of each row.
example drawing:
Code:
link1 link2 link3
+------+
| | - row has id="row1"
+------+
| | - row has id="row2"
+------+
| | - row has id="row3"
+------+
[[submit]]
link1 sets row2 & row3 display = none - row1 displays.
link2 sets row1 & row3 display = none - row2 displays.
link3 sets row1 & row2 display = none - row3 displays.
in NS6, clicking submit only sends fields that are in a visible row. is there a way around this?
|

February 8th, 2001, 03:49 PM
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 300
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
Sure, instead of display: none, use visibility: hidden. You see, by setting the display: none of an element, you are practically "deleting" it from your page. So, its quite normal that the submission works only for those elements that are still "displayed" on yur page.
Just one note: setting the visibility to hidden will preserve canvas space, which means the object will just vanish, but the space it occupied will be still there... 
|

February 9th, 2001, 08:13 AM
|
|
Junior Member
|
|
Join Date: Dec 2000
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Thanks!
|

February 14th, 2001, 12:34 PM
|
|
Junior Member
|
|
Join Date: Feb 2001
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Re: Dwarf's comments
I disagree with dwarf's assessment. There is nothing in the CSS-1, CSS-2, or HTML 4.x recommendations that I am aware of that would dictate Netscape 6's exclusion of form elements hidden with "display: none". Internet Explorer does *not* exclude such form elements, incidentally. I consider this a Netscape 6 bug, of which, unfortunately, there are many.
|

February 14th, 2001, 12:53 PM
|
|
Junior Member
|
|
Join Date: Feb 2001
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Re: Netscape 6 display:none Form-Submission Bug
Sorry, should have researched this before posting, but here is confirmation that this behavior *is* a Netscape bug:
http://bugzilla.mozilla.org/show_bug.cgi?id=34297
It appears that the Mozilla team will attempt to fix this by build 0.9, but I can't say how that will translate into a fix in Netscape 6.x. Netscape 6.01 has this same problem, btw. Perhaps a fix by 6.02, but that is a complete guess.
In the meantime, dwarf's suggested workaround is probably the best available.
|

February 14th, 2001, 02:28 PM
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 300
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
Well, I was speaking from my printing experience. When you set the display property to "none", those elements don't print. So I just went that way.
Anyways, visibility is something that should be used in these situatations, because it clears all of those risks... 
|

February 14th, 2001, 03:39 PM
|
|
Junior Member
|
|
Join Date: Feb 2001
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
dwarf,
In theory, I would agree with you that using "visibility: hidden" would be an appropriate workaround in order to support Netscape 6.x. Unfortunately, based on further testing with Netscape 6.01, I have to say there is no satisfactory way to hide form elements with the expectation that they will submit successfully.
Using "visibility: hidden", Netscape 6.x will submit the form element, but it will *not* submit the value. This, paired with the problems of using "display: none", is a fatal flaw for Netscape 6. This is simply unforgivable.
|

February 14th, 2001, 04:03 PM
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 300
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
Jesus...I had no idea that that thinsg is so buggy. I still haven't tried Mozilla 0.7 that much, since its newer in date than Netscape 6.0 (I'm not sure about 6.1 though...) that much, so I cannot say whether the bug is still in there, but it is awful really.
Just an informative question: hidden fileds, as in <input type="hidden"> still work as expected, right??
|

February 15th, 2001, 11:43 AM
|
|
Junior Member
|
|
Join Date: Dec 2000
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
i'm not too sure about hidden fields ... i'll have to test it later.
for now, onsubmit triggers display of all rows before the form is sent out.
sucks, i know, but that's the only way i could think of (other than mirroring all the field values in hidden fields).
oh ya, screen redraw sux bad in NS6 -- toggling display none/block usually results in "traces".
[Edited by labcede on 02-15-2001 at 10:46 AM]
|

February 15th, 2001, 04:19 PM
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 300
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
How about trying Mozilla 0.7?? Itsd only 9 megs to download, and display toggling works just fine. No traces...NS 6 was made some 3 versions ago, I think...
|

February 16th, 2001, 10:37 AM
|
|
Junior Member
|
|
Join Date: Feb 2001
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Mozilla 0.8
I ran my test page (with the visibility property of some form elements set to "hidden", and the display property of some others set to "none") using Mozilla 0.8 (just released). The hidden form elements did succeed, although the "display: none" elements did not. Curiously, I retested in Netscape 6.01 (which is based on the Mozilla build from 01/31/2001), and it works now. I'm not sure if that suggests intermittent problems with hidden form fields, or if installing the Mozilla 0.8 build on the same machine might have updated a shared file.
Bottom line, however, is that form fields with their display property set to "none" still do not succeed.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|