473,327 Members | 2,025 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,327 software developers and data experts.

How to Get a Dynamic Checkbox Array to Variables

ak1dnar
1,584 Expert 1GB
Hi, I want to submit this Form contents after validating them.This check box is inside a loop and it will display along with some products items .Before i submit the form i want to check whether user has selected at least one of the check boxes.
ex: for 3 products there will be 3 checkboxes in the out put page.
[HTML]
<!-- This check box is Dynamically Display from the PHP.
$id will make 1001,1002,1003 and it does not make any Duplicates.-->
<input type="checkbox" name="frm_chk_delete[]" value="'.$id.'" />
[/HTML]

I am going to submit this using a image.

[HTML]<a href="javascript:update()"><img src="images_in/b_update.jpg" alt="Update" /></a>[/HTML]

And it will call for this JS

Expand|Select|Wrap|Line Numbers
  1. function update(){
  2.     document.inq_form.action="update.php";
  3.     document.inq_form.submit();
  4.     }
How do i genarate a error message when user does not select at least on of the check boxes before he Submit the form.
Mar 8 '07 #1
1 4158
acoder
16,027 Expert Mod 8TB
Loop through the checkboxes and check each one for its checked value. If all of them are false, then return false to prevent the submit.
Mar 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Pete | last post by:
I have some session variables which get set on page one of my site. I can set an unset these by passing through a parameter in some URL's. When the user goes to the second page some checkboxes are...
5
by: pizzy | last post by:
I am having a problem with the last results. I can't seem to be able to get the input2A and input3A to appear. I don't seem to have a problem with the show and hide after a number is entered and...
3
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which...
34
by: clinttoris | last post by:
Hello Experts, I have been told to post this in the Javascript forum as I want to do this client side just before my form gets submitted. Once the user clicks the submit button a javascript...
1
by: Satish.Talyan | last post by:
hi, i want to create a dynamic tree hierarchy in javascript.there are two parts in tree, group & user.when we click on group then users come under that's tree category will be opened.problem is...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
1
by: wissenwill | last post by:
Hello! I need help to modify the following JavaScript: <script language="javascript"> var flds = "chk1,chk2,chk3,chk4".split(",") var vals = new Array(2,4,8,16) var msgs = new Array();
0
by: fatesgrasp | last post by:
Hi. I have an asp page which is connects to an access database from which it loops through a recordset to create a checkbox for each record. I have a script that's suppose to calculate a total value...
4
by: ATDave | last post by:
So basically I'm just creating a form that I want the results e-mailed to somebody. I have everything working except for the checkmark sections that can have multiple answers. I'm a newbie when...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.