form check

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

    form check

    Hi,

    i have a form where i defined a checkbox in that is later processed
    by a php page.
    This is an excerpt:

    <INPUT TYPE="checkbox" NAME="type[]" VALUE="speler"> speler</INPUT><br>
    <INPUT TYPE="checkbox" NAME="type[]" VALUE="trainer" >trainer
    (toekomstig)</INPUT><br>
    <INPUT TYPE="checkbox" NAME="type[]"
    VALUE="scheidsr echter">scheids rechter (toekomstig</INPUT/><br>
    <INPUT TYPE="checkbox" NAME="type[]"
    VALUE="bestuurs lid">bestuursli d</INPUT><br>
    <INPUT TYPE="checkbox" NAME="type[]" VALUE="actiefli d">actief
    lid</INPUT><br>
    <INPUT TYPE="checkbox" NAME="type[]" VALUE="fan">fan </INPUT><br>

    How can i check to see if something was selected or not?
    I tried several things for instance document.form[0].type.value
    but i get "is empty or not an object".
    How do i know what has been selected and what the value is?

    Thanks


  • Lasse Reichstein Nielsen

    #2
    Re: form check

    "flupke" <flupke@flupke. com> writes:
    [color=blue]
    > i have a form where i defined a checkbox in that is later processed
    > by a php page.
    > This is an excerpt:
    >
    > <INPUT TYPE="checkbox" NAME="type[]" VALUE="speler"> speler</INPUT><br>[/color]

    <URL:http://jibbering.com/faq/#FAQ4_25>
    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • flupke

      #3
      Re: form check

      Lasse Reichstein Nielsen" <lrn@hotpop.com > schreef in bericht
      news:n0ec19w4.f sf@hotpop.com.. .[color=blue]
      > "flupke" <flupke@flupke. com> writes:
      >[color=green]
      > > i have a form where i defined a checkbox in that is later processed
      > > by a php page.
      > > This is an excerpt:
      > >
      > > <INPUT TYPE="checkbox" NAME="type[]"[/color][/color]
      VALUE="speler"> speler</INPUT><br>[color=blue]
      >
      > <URL:http://jibbering.com/faq/#FAQ4_25>[/color]

      form.elements[type[]'][1].checked returned false or true depending on wether
      the 2nd element
      was checked or not.
      It all works great now.
      Thanks!


      Comment

      Working...