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

ajax POST checkbox

7
guys,

I can't seem to find any info on how to pass a list of checked checkboxes through POST method of ajax.

Unlike traditional forms, when you submit a button, a list of selected checkboxes with the same name will allow you to retrieve it at the server side (php in my case).

IS this the only way?

Expand|Select|Wrap|Line Numbers
  1.  param = "selecteditem = " + document.myform.item[0].value;
  2. param+ = "&selecteditem = " + document.myform.item[1].value;
  3. param+ = "&selecteditem = " + document.myform.item[2].value;
Can there be any other ways so that i won't have to manually append each value to the same variable before posting the data?
Nov 24 '07 #1
1 2239
gits
5,390 Expert Mod 4TB
hi ...

since you don't post the page you have to build the querystring for your own ... because you have to identify the values for your own that have to be send to the server ...

but you may write a generic function that you may call in case of building the querystring ... the function should retrieve all input-fields of the page or a specific node ... and always builds a querystring from it ...

kind regards
Nov 24 '07 #2

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

Similar topics

3
by: noballack | last post by:
I've got a problem, I'm working with Ajax in a web with a form with a list of checkbox added to the form via an Ajax.Updater method. These added checkboxs are not been sended by the form if I use...
4
by: d3vkit | last post by:
I have a form on my page, and some javascript which uses ajax to submit the form, and then opens the new page in a div using ajax so there is no refresh. This works fine. But the problem is this: all...
7
by: Bill Gower | last post by:
I have a asp.net form where if the user checks a check box I need to disable some of the fields. I don't need to make a trip to the server for anything at this point so is this is a case of using...
3
by: John Mott | last post by:
This is a total ID-10T error, but since its my first attempt I'm missing the obvious. I downloaded the framework, create an AJAX enabled app, added a page, and added an update panel with this: ...
3
sunbin
by: sunbin | last post by:
Hi, I am having in a Trouble when working with dynamic checkboxes (i.e. checkboxes with the same name, e.g. <input type="checkbox" name = "check" value="dynamic integer value">) I have...
3
by: arggg | last post by:
I have a form in PHP that needs to be processed by the same page. I have ajax calling the page and parsing the data however I cannot get the POST data to be sent via AJAX to the PHP Page. I found...
1
by: Mark B | last post by:
This is my first try at using AJAX. I want the calendars to be enabled if the user checks CheckBox1. It works OK for a normal all page refresh but once I introduced the AJAX code it stopped...
0
by: Tim | last post by:
Hi all, I'm using AJAX.NET and I've coded a page that changes the text of a button when a checkbox is clicked. The text changes from "Save" to "Keep Processing". The text change seems to...
1
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
0
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...
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: 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...

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.