473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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="scheidsrechter">scheidsrechter (toekomstig</INPUT/><br>
<INPUT TYPE="checkbox" NAME="type[]"
VALUE="bestuurslid">bestuurslid</INPUT><br>
<INPUT TYPE="checkbox" NAME="type[]" VALUE="actieflid">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
Jul 20 '05 #1
2 1804
"flupke" <fl****@flupke.com> writes:
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>


<URL:http://jibbering.com/faq/#FAQ4_25>
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Lasse Reichstein Nielsen" <lr*@hotpop.com> schreef in bericht
news:n0**********@hotpop.com...
"flupke" <fl****@flupke.com> writes:
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>
<URL:http://jibbering.com/faq/#FAQ4_25>


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!
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Norman Bird | last post by:
I have a form i will use to register new people and when I click the submit button, the form just shows itself. It is supposed to show a message showing field errors if you leave fields blank etc....
4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
12
by: szar | last post by:
I'm passing numerous array elements called list when a form is submitted. the brackets are necessary for PHP to see all the values as an array. The problem is I can't seem to reference the form...
2
by: Edward | last post by:
The following html / javascript code produces a simple form with check boxes. There is also a checkbox that 'checks all' form checkboxes hotmail style: <html> <head> <title></title> </head>...
2
by: Fred | last post by:
Hi, I defined a form consisting of checkboxes like: <form> <input type="checkbox" name=ck id=ck onclick="check(this.form)" <input type="checkbox" name=ck id=ck onclick="check(this.form)" ........
6
by: WindAndWaves | last post by:
Hi Gurus In my quest in putting my first javascript together, I am now trying to conquer something that seems trivial, but has taken me hours. I would like to format a field in a form once the...
4
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.