Function To Check Related Checkboxes

Aug 29, 2004

My application displays a list of checkboxes to the user. Some of the boxes are related. For eg:

List of boxes:
a
b
c
d

Checkboxes a and c are related. If user checks a; c should automatically be checked and vice-versa. Same for de-checking. I need a function to do this.

View 4 Replies


ADVERTISEMENT

Sending Arguments To Function Related To Pop Up Window

Mar 24, 2009

This is related to the pop-up window. Below is the function related to pop-up window.
function openPopUpDetailsMultiple(seqNum ,controllername ) {
if (!popUpDetails||popUpDetails.closed) {
popUpDetails=window.open("GetSCEventAddData?schandle=<!.schandle>&objID=<!.objID>&seqnum="+seqNum+"&controllername="+controllername+,"popUpDetails","toolbar=1,location=0,scrollbars=1,width=600,height=300,resizable=1,left=200,top=200");
}else{
popUpDetails.focus();
popUpDetails.location="GetSCEventAddData?schandle=<!.schandle>&objID=<!.objID>&seqnum=" + seqNum;
} }

The above function is being called in the href link as stated below:
//Draw the event table
document.write("<table border=1 bgcolor=" + contrColor + " cellpadding=3 cellspacing=0 width=750><tr><td width=130 valign=top class=body align=center rowspan=2>" + scEv[i].sceTime + "<br>" + scEv[i].sceDate + "<br>" + scEv[i].sceCntr + "</td><td width=60 valign=top class=body align=center><img src=images/NsaAlarm"+sevIcon+".gif border=0 height=16 width=16 align=middle alt='" + sevText + "'></td><td width=230 valign=top class=body align=center>" + scEv[i].sceCode + "</td><td width=230 valign=top class=body align=center>#" + scEv[i].sceSeq + "</td></tr><tr><td width=620 valign=top class=body colspan=3>" + scEv[i].sceDesc + "<br><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td class=body><a href=javascript:openPopUpCAC('" + scEv[i].sceCAC + "')><img src=images/NsaTools.gif border=0 height=16 width=16 align=middle alt='View corrective actions'>Corrective action code: " + scEv[i].sceCAC + "</a></td><td align=right class=body><a href=javascript:openPopUpDetailsMultiple('"+ scEv[i].sceSeq+"''"+ scEv[i].sceCntr +"')><img src=images/NsaMoreDetails.gif border=0 height=16 width=16 align=middle alt='View more details'>More details</a></td></tr></table></td></tr></table>");

The problem I'm facing now is in this piece of code:
><a href=javascript:openPopUpDetailsMultiple('"+ scEv[i].sceSeq+"''"+ scEv[i].sceCntr +"')><img src=images/NsaMoreDetails.gif border=0 height=16 width=16 align=middle alt='View more details'>More details</a></td></tr></table></td></tr></table>");
I do not know how to send these (scEv[i].sceSeq,scEv[i].sceCntr) arguments. What might be the delimiter for these arguments.

View 1 Replies View Related

Each Thumbnail Would Need Their Own Bit Of Code That Calls On A Function Related To The Full Size Image Url?

Mar 12, 2009

I am trying to make a site for a photgrapher where the user see's thumbnails of his pictures, then when the pictures are clicked on I want them to open up in a dynamic content box.I can only assume that this is JS/AJAX coding that does this.I have found the following bit of code that does almost this. Except it performs the function on page load and not on mouse click and it opens one of two pages randomly.

var interstitialBox={
//1) list of files on server to randomly pick from and display
displayfiles: ['samplecontent.htm', 'samplecontent2.htm'],[code]...

from what I can tell, each thumbnail would need their own bit of code that calls on a function related to the full size image url.

View 2 Replies View Related

JQuery :: Related To Setting Global Variables From Anonymous Function (valid = False;)?

Oct 22, 2010

//<input type="text" id="s_field" value=""/>
var valid = true;
var div = $("#s_field");
$.post("index.php",{id: 6}, function (data){

[Code]..

When posting data, and getting response need to set valid to false - email is not valid.

1. in function it alerts valid is false
2. outside function it says valid is still true!

even i didn't wrote var valid = false;, but valid = false;I need to set Global "valid" variable to false.

View 1 Replies View Related

Check All Checkboxes

Sep 29, 2004

I know there is a lot of free, easy-to-find scripts that will check all checkboxes in a form, however, all of the working ones I found require you to pass the name of the checkbox. My checkboxes are being generated in .NET so they all have a unique name.

Is there a simple way to loop through every form element and check it if it is a checkbox and than either check it or uncheck it based on a passed value?

View 2 Replies View Related

How Do I Check If At Least One Of Several Checkboxes Has Been Checked?

Jul 20, 2005

I have a form with several questions. Within each question there are several checkboxes. I need to ensure that the user checks at least one checkbox. They can check more but must check at least one.

How would I do this in Javascript?

View 5 Replies View Related

JQuery :: Check All Checkboxes?

Sep 17, 2010

I have a form with three different fields. Each field is an array made of checkboxes. I'd like to have three "checkall" checkboxes, one for each field, so that you only click once to select every checkbox of the array (or rather of what will be treated as an array server side).How would you do that? Could you point me to a possible scenario? I've spent a few hours on this problem without reaching any interesting result

View 1 Replies View Related

Validate Checkboxes Check No More Than 2

Aug 27, 2006

I need to validate checkoxes to make sure the user selects no more than 2 of the checkboxes. The problem I'm having is in the naming of the checkboxes. The PHP form processor portion of the page requires the checkboxes to be named "dogs[beagle]". This is causing problems with the javascript validation. This is what I have so far...since I've used just the first part of the checkbox name "dogs" the script is not working..I'm kind of new to javascript...Anyone have any suggestions on how to make this work. Code:

View 4 Replies View Related

JQuery :: Check Value For Checked Checkboxes?

Mar 30, 2011

My PHP-script generates checkboxes following this pattern:

<input name="checkbox_group[]" id="checkbox_1" value="1" />
<input name="checkbox_group[]" id="checkbox_2" value="2" />

I have tried every solutions I could find, like these:

var
values
=

[code]....

View 13 Replies View Related

Check All Checkboxes Using One Main Checkbox?

Mar 3, 2010

I want to check all checkboxes using one main checkbox. Then, the checkboxes will be disabled. But then, when the user unchecks the main checkbox, it must revert all the checkboxes to be enabled. How do I do so?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

[Code]....

View 1 Replies View Related

Check Group Of Checkboxes And Disable Them

Feb 22, 2006

I've got the following form, which contains two groups of checkboxes: Code:

<form name="myForm">
<input type="checkbox" name="Group1_1" />Group1_1<br />
<input type="checkbox" name="Group1_2" />Group1_2<br />
<input type="checkbox" name="Group1_3" />Group1_3<br />

<input type="checkbox" name="Group2_1" />Group2_1<br />
<input type="checkbox" name="Group2_2" />Group2_2<br />
<input type="checkbox" name="Group2_3" />Group2_3<br />
<input type="checkbox" name="Group2_4" />Group2_4<br />
<input type="checkbox" name="Group2_5" />Group2_5<br />
</form>

I need to be able to check all group 2 checkboxes and disable them from being unchecked when checkbox group1_3 is checked. Unchecking group1_3 checkbox will uncheck all group 2 checkboxes. Does this make sense? Is this possible with Javascript? If so, can anyone suggest how?

View 3 Replies View Related

Using Buttons To Check And Uncheck Checkboxes

Dec 8, 2010

I'm trying to write some code that uses buttons to check and uncheck certain checkboxes. I am stumped and all the code I have been finding is using for loops to check or uncheck all the boxes, when I just want to check or uncheck certain ones. Here's an example of the type of function I'm trying to use:
function checkSome (form) {
document.myForm.list.one.checked = true;
document.myForm.list.two.checked = true;
document.myForm.list.three.checked = false;
}
And the button:
<input type="button" value="Option 1" onClick="checkSome(this.form)"/>

View 3 Replies View Related

JQuery :: Check / Uncheck All Checkboxes At Nth Level?

Aug 7, 2011

I am new to JQeury and facing issue to Check/Uncheck all checkboxesatnth level.

View 1 Replies View Related

JQuery :: Check/uncheck Checkboxes At Nth Level?

Aug 7, 2011

facing issue to check/uncheck checkboxes at nth level.

View 1 Replies View Related

JQuery :: Check/uncheck All Checkboxes In A Form?

Jun 24, 2010

I have checked over my code several times and cannot find what I've done wrong with my first script, which is to check/uncheck all checkboxes in a html form. Nothing is checking or unchecking, and I am seeing the "Error on this page" in IE whenever i first click one of the two buttons. Here are the steps I have taken1. I have imported the jQuery library which I have just downloaded (1.4.2 development version, 155kb) with the following code:

< script
type
= "text/javascript"

[code]....

View 4 Replies View Related

JQuery :: Check/uncheck All Checkboxes With Specific Id?

Jun 30, 2009

I want to check all of my checkboxes in my form that have an id that begins with 'chkEvent'.

<script language="Javascript" type="text/javascript">
$(document).ready(function() {
$("#toggleEvents").click(function(event){
$('input[@type=checkbox]').each( function() {

[Code].....

View 7 Replies View Related

JQuery :: Select Cannot Check Checkboxes' States?

Sep 23, 2009

i have a group of check boxes, and i want to iterator over all the checked ones. i use the following code, but without luck.

$("input[type=checkbox][checked=true]").each(function()...);

[URL]

View 6 Replies View Related

POST Array And Check/Uncheck Checkboxes?

Sep 18, 2009

So that I can pass multiple checkbox values to my PHP processing script as an array I added the square brackets to my form's checkbox input element's name, like this: <input type="checkbox" name="checkGroup[]" value="'.$rowIDs.'" /> Because it has to match, I updated the input element I use to check/uncheck all the checkboxes so that it now looks like this: <input type="checkbox" name="all" onClick="checkAll(document.ResIDsDates.checkGroup[],this)" />

When I manually select multiple checkboxes I can successfully pass any number of checkbox values through
the POST array to my process script...but my Check/Uncheck All box has ceased working -- adding the
square brackets to the checkbox input's name disabled it.

I tried playing with the ASCII equivalents to the brackets, but no go. Is there a way to retain the array
functionality and pass multiple checkbox values to the script AND enable the Check/Uncheck All box?

View 1 Replies View Related

JQuery :: Using To Check/uncheck Group Of Checkboxes Dynamically?

Oct 7, 2011

I have a page that has groups of checkboxes that are generated dynamically. The identifiers for all the text boxes are generated dynamically so i dont know what the name will be for any of the checkboxes before the page has loaded.Each group of checkboxes has a master checkbox and several child checkboxes. Each master checkbox has a unique ID. All child checkboxes have a 'class' element which is the ID of its master checkbox. I want to use the ID of the master checkbox to determine which checkboxes to check/uncheck. When the master checkbox is clicked, i want all its associated children (i.e where child.class=master.id) to be checked or unchecked. Here is an example of what i have so far

<HTML>
<HEAD>
<script type="text/javascript"

[code]....

View 1 Replies View Related

Ist Of Checkboxes From Which The User Can Select 1 Or More To Check And Perform An Action Upon?

Feb 11, 2011

As this forum has been so helpful before, this time it's a JS question:I have a list of checkboxes from which the user can select 1 or more to check and perform an action upon.Thus, all checkboxes have the same "name" (in ASP code, since it's DB-related):

response.write "<input type=checkbox name=""FieldName"" value="&obj("OrderID").value&">"
I call JS using a button:
<img src="images/TrashBin.png" border=0 onclick="Delete(document.FormName.FieldName)">

[code]....

View 3 Replies View Related

Input Browser Command Line To Check All Checkboxes

Oct 29, 2009

From a browser address bar command? Say if a page has hundreds of checkboxes, and I needed to check them all, but only 2-3 should be left out, how do I input a browser command line, to check it all, so I will manually uncheck the 2 or 3 that's not needed?

View 3 Replies View Related

Allowing User Check / Uncheck All Checkboxes In Form

Dec 20, 2011

I am trying to allow a user to easily uncheck/check all checkboxes in a form by checking or unchecking a checkbox. The checkboxes would be in a form like so:
<form action="" method="post">
<input type="checkbox" name="checked[]" value="1">
<input type="checkbox" name="checked[]" value="2">
<input type="checkbox" name="checked[]" value="3">
<input type="checkbox" name="checked[]" value="4">
</form>

I use an event handler to call a function:
<input type="checkbox" name="checkall" onchange="checkall('checked[]', this.checked)">

And here is the function:
function checkall(box_name, current_state) {
all = document.getElementsByName(box_name);
action = (current_state == "checked") ? "false" : "true";
for (i = 0; i < all.length; i++) {
all[i].checked=action;
}}

The event handler should pass the name of the checkboxes and whether the "check all" checkbox is currently checked or not to the checkall() function. Nothing happens when I check/uncheck the "check all" function.

View 2 Replies View Related

Multiplying And Addition - Allow Users To Check One Or More Of The Checkboxes And Multiply It By A Quantity

Jan 30, 2009

I am having trouble making a website for a vacation rental I pieced this javascript code and form together with a simple goal in mind: -to have 3 checkboxes each with its unique variable

weeks: 2,000
weekends: 325
weekdays: 275

-to allow users to check one or more of the checkboxes, and multiply it by a quantity they choose (ie "I'd like to stay for two weeks (2 x 2,000=6,000) and one weekday (1 x 275=275)

-finally, to add up the totals at the end (6,000 + 275=6,275)

[Code]...

View 1 Replies View Related

Check Multiple Checkboxes If Checked Make Divs Visable?

Jun 24, 2011

I have a large form that I would like it to check if there are any check boxes that are checked, if there are then open the divs attached to them. I have this working off of an onclick event but it's not working on load. This link is very close but only works off of one checkbox. http://www.sitepoint.com/forums/php-...sh-756260.htmlHere is the code that I am currently using:

HTML Code:
$('div[class^=opentoggle]').hide();
$('input[class^=toggle]').click(function() {

[code].....

View 4 Replies View Related

JQuery :: Using Check/uncheck Multiple Checkboxes In A Specific Row Based On Another Checkbox?

Jul 29, 2011

someone here might know what I'm doing wrong. I have a list of checkboxes, in multiple rows with each along the lines of:

[Code]...

View 3 Replies View Related

JQuery :: Checkboxes Won't Make A Call To UpdateResults Function Within $function()?

Jun 11, 2011

I have a real perplexing issue. In two separate "projects" I had code that displayed checkboxes - when clicked, they would fetch information from a db and display it in the div below. I had code that displayed a jquery date-picker - when clicked, it would fetch information from a db and display it in the div below. My issue comes with this:

[Code]...

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved