Just FYI, the duplicate names can cause issues too, but in IE. In IE,
getElementById really means getElementByIdOrName...so if you have (for
example) a label with a name "username" and a textbox with an id
"username", whichever one comes first in the DOM will be picked up by
IE.

-Jerod Venema

On 6/28/06, Keith Davis <[EMAIL PROTECTED]> wrote:

Oooh, didn't see that.That was a mistake, but surely was causing a problem
like you say. thanks.


Keith Davis (214) 906-5183


________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Gregory Hill
Sent: Wednesday, June 28, 2006 3:29 PM

To: rails-spinoffs@lists.rubyonrails.org
Subject: RE: [Rails-spinoffs] Event.observe

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Gregory Hill
Sent: Wednesday, June 28, 2006 3:29 PM

To: rails-spinoffs@lists.rubyonrails.org
Subject: RE: [Rails-spinoffs] Event.observe




No, but the text input has the same id, at least in the code snippet you
sent.  That is what I was referring to.



Greg



________________________________


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Keith Davis
Sent: Wednesday, June 28, 2006 2:13 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: RE: [Rails-spinoffs] Event.observe



Actually, my original code doesn't have an ID for the HIDDEN input. They
have the same Name though. Strange.




Keith Davis (214) 906-5183





________________________________


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Gregory Hill
Sent: Wednesday, June 28, 2006 3:09 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: RE: [Rails-spinoffs] Event.observe

Actually, I think the problem is that you have 2 inputs with the same id.
That is technically impossible, although Firefox tends to not complain about
it (I think it just grabs the first match).  IE just dies because it doesn't
know what to do.  At least, that's what I seem to remember.  2 elements are
not allowed to have the same id.  Same name is fine, but be advised, most
server software will pack all of the values into an array, so you might be
expecting a string and get an array instead.



Greg



________________________________


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Keith Davis
Sent: Wednesday, June 28, 2006 2:01 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: RE: [Rails-spinoffs] Event.observe



I figured out what the problem is. I thought JavaScript watched the ID not
the name. As you can see, I've got a hidden input before the checkbox. That
is on purpose. Since IE doesn't send unchecked checkboxes, I had to place a
hidden before the actual checkboxes to clear the values in the SQL or
unchecking the box wouldn't have any effect. This works in Firefox and until
now, it worked in Internet Explorer. Is there any other way I can specify
the checkbox input only?




Keith Davis (214) 906-5183





________________________________


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Keith Davis
Sent: Wednesday, June 28, 2006 2:56 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: RE: [Rails-spinoffs] Event.observe

I just realized that this works in Firefox, but not in Internet Explorer.
Why would that be?




Keith Davis (214) 906-5183





________________________________


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Keith Davis
Sent: Wednesday, June 28, 2006 2:53 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: [Rails-spinoffs] Event.observe

Aaarrrggh. Here's the actual code that I need to work:

                        <INPUT TYPE="HIDDEN" NAME="assess_int9" VALUE="">
                        <INPUT TYPE="CHECKBOX" NAME="assess_int9" VALUE=":"
CHECKED="CHECKED" CLASS="radiocheck" ID="assess_int9">

                        :
                        <INPUT TYPE="TEXT" NAME="assess_int9_s0" CLASS=""
STYLE="" ID="assess_int9" VALUE="sfsadfsdf">
                        <SCRIPT LANGUAGE="JAVASCRIPT"
TYPE="TEXT/JAVASCRIPT">
                                Event.observe('assess_int9', 'click',
function() { ClearTextIfNotChecked('assess_int9',
'assess_int9_s0') = ''; });

                        </SCRIPT>



However, I did this as a test and it doesn't work either and no error:

                        <INPUT TYPE="HIDDEN" NAME="assess_int9" VALUE="">
                        <INPUT TYPE="CHECKBOX" NAME="assess_int9" VALUE=":"
CHECKED="CHECKED" CLASS="radiocheck" ID="assess_int9">

                        :
                        <INPUT TYPE="TEXT" NAME="assess_int9_s0" CLASS=""
STYLE="" ID="assess_int9" VALUE="sfsadfsdf">
                        <SCRIPT LANGUAGE="JAVASCRIPT"
TYPE="TEXT/JAVASCRIPT">
                                Event.observe('assess_int9', 'click',
function() { alert('test'); } );
                        </SCRIPT>

_____________________
Thanks,

Keith Davis - MCSA, A+, N+
P.R.I.D.E. - Director of Computer Services
www.pridedallas.com
Work (214) 351-6600 ext. 119
Mobile (214) 906-5183



_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs



_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to