REQ:

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • solitaire

    REQ:

    Hi,

    I have a little problem with the internet explorer 5.2 for mac. I have a
    checkbox field which name is an array, but then I can't read the field on IE
    for MAC. Other browsers don't seem to have problems with it, if I set the
    id's of the field the same as the name is. Anybody has a solution?

    Code:

    <script>

    function chklength(field ) {

    alert(field.len gth);

    }

    </script>

    <form name="test">

    <input type="checkbox" name="testfield[]" id="testfield" value=1> <input
    type="checkbox" name="testfield[]" id="testfield" value=2> <input
    type="button" onclick="chklen gth(this.form.t estfield)"

    </form>

    Thanks in advance,

    Ben



  • Randy Webb

    #2
    Re: REQ:

    solitaire wrote:
    [color=blue]
    > Hi,
    >
    > I have a little problem with the internet explorer 5.2 for mac. I have a
    > checkbox field which name is an array, but then I can't read the field on IE
    > for MAC. Other browsers don't seem to have problems with it, if I set the
    > id's of the field the same as the name is. Anybody has a solution?
    >
    > Code:
    >
    > <script>
    >
    > function chklength(field ) {
    >
    > alert(field.len gth);
    >
    > }
    >
    > </script>
    >
    > <form name="test">
    >
    > <input type="checkbox" name="testfield[]" id="testfield" value=1> <input
    > type="checkbox" name="testfield[]" id="testfield" value=2> <input
    > type="button" onclick="chklen gth(this.form.t estfield)"
    >
    > </form>[/color]

    Read the FAQ, and it explains how to access a form element with PHP-like
    names.


    document.forms['formName'].elements['testfield[]'].property;



    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javas cript FAQ - http://jibbering.com/faq/

    Comment

    Working...