close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Select all checkbox on multiple update

Thread began 2/14/2012 6:55 am by georgina_barrett_187762 | Last modified 2/15/2012 2:02 am by Dave Buchholz | 1347 views | 2 replies |

georgina_barrett_187762

Select all checkbox on multiple update

I have a page with a repeat region and multiple update. It is updating the value of a checkbox. This all works however there are 200 records on each page and if the user is wanting to select all of them they must tick every box individually. Is there a way of adding a checkbox at the top to select all. I have found a code that will do this on a normal set of checkboxes however because of the multiple update the checkboxes are named:"SendText_<?php echo $RepeatSelectionCounter_1; ?>" - not simply 'SendText'

With the code I have the inputs would need to have the same name. This is the javascript code:
<script language="JavaScript">
function toggle(source) {
checkboxes = document.getElementsByName('SendText');
for each(var checkbox in checkboxes)
checkbox.checked = source.checked;
}
</script>
<input type="checkbox" name="master" id="master" value="Y" onClick="toggle(this)" />
<input <?php if (!(strcmp($row_WADALeads['SendText'],"Y"))) {echo "checked=\"checked\"";} ?> name="SendText_<?php echo $RepeatSelectionCounter_1; ?>" type="checkbox" id="SendText_<?php echo $RepeatSelectionCounter_1; ?>" value="Y" />
<input <?php if (!(strcmp($row_WADALeads['SendText'],"Y"))) {echo "checked=\"checked\"";} ?> name="SendText_<?php echo $RepeatSelectionCounter_1; ?>" type="checkbox" id="SendText_<?php echo $RepeatSelectionCounter_1; ?>" value="Y" />

Sign in to reply to this post

Jason ByrnesWebAssist

see this page for a tutorial on referencing the form elements by type:
Gettheelementtype.htm



you could modify this example to check all of the check boxes using the element type.

Sign in to reply to this post

Dave BuchholzBeta Tester

Georgina,

I use a query plugin for this kind of functionality, you can find it here

You can use it to toggle checkboxes on or off, select only those with a particular class etc.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...