Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Client Side Event :: Writing Text based on Checkbox Selection
Last Post 04-10-2012 09:39 AM by Tim Hardin. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Tim HardinUser is Offline
wading in the water
wading in the water
Posts:24
Avatar

--
04-05-2012 03:24 PM
    OK,
    I want to write text to a field based on what options are selected in a set of about 15 checkboxes.  I am hoping to do this as a client side event.

    How it should work visually:
    ======================================
    [] Box A
    [x] Box B
    [] Box C
    [] Box D
    [x] Box E

    [x] Click to calculate what is checked above (this is where I think the client side event will go)

    The following checkboxes were checked: B, E
    ======================================

    I Cannot use the "Value" field as it is being used to calculate another field (Cost) already. 

    Any ideas?
    Thanks in advance
    Tim
    David LoofbourrowUser is Offline
    wading in the water
    wading in the water
    Posts:17
    Avatar

    --
    04-06-2012 03:53 PM
    Hi Tim!

    There may be a more elegant way to do this but...

    I would collect the text into a HIDDEN TYPE field using a series of If statements in the client side event box. Test your code in ONE checkbox, but then when it is working, you will have put THE WHOLE LOT of it into ALL the checkboxes' Client side event AND in the Initial Javascript in the Module Configuration (so it rebuilds the string in the case of a postback refresh.)

    First create the hidden field - we will call it "boxString" (NOTE you could do this directly into a disabled text field, too, with the label of the text box "The following checkboxes were checked" but it is less flexible )

    So, the javascript will be something like:

    $(boxString) = '';
    if ($(boxA) == true) { $(boxString) = ' A,' ;}
    if ($(boxB) == true) { $(boxString) = $(boxString) + ' B,' ;}
    if ($(boxC) == true) { $(boxString) = $(boxString) + ' C,' ;}
    etc....

    NOTES:
    1. Always use single quote marks, sometimes called 'tick' marks.
    2. Clear the boxString field first, to be sure you get a clean build.
    3. The CASE of JavaScript and even the field names is important to be exact.
    4. Remember that client side events push, not pull. So, the code must be in the question that has the action. (Putting this code in the Hidden Field will do exactly nothing.)

    If you have set this up as a hidden field, then you can use its value either by assigning it (at the end of the long line of ABC) to a text box:
    $(displayFieldHere) = $(boxString) ;

    or by doing an HTML injection as described in Demonstration #20:

    http://www.datasprings.com/products...nstrations

    ANOTHER lesson learned is there is a limit to the amount of code you can get into a Client Side Event. If you run out of room, you will have to create this as a function in the Javascript settings. I can't help you there... There are some posts in the Form on the topic, however.

    Hope this helps!

    David
    Tim HardinUser is Offline
    wading in the water
    wading in the water
    Posts:24
    Avatar

    --
    04-10-2012 09:07 AM
    That looks like it just might work! I will let you know.
    I just hope I don't run into the cap on the client-side event javascript...
    Tim
    Tim HardinUser is Offline
    wading in the water
    wading in the water
    Posts:24
    Avatar

    --
    04-10-2012 09:39 AM
    David,
    Thanks, that 'mostly' worked.
    I had to change my Checkbox Groups into basic Checkboxes.
    I had used Checkbox Groups for the purpose of having numeric values that I could do arithmetic with for another aspect of this form.

    SO, my followup question is this:
    Is there a similar syntax to:
    if ($(Eng201) == true) that would work for a single item checkbox group?
    maybe something like:
    if ($BoxA_FieldID ) == true) ?

    I am currently using this:
    CalculateCheckBoxListValues($(Eng201_FieldID),$(Eng201_ValueFieldID)))*200;

    So I imagine it would be somewhat related...

    Thanks,
    Tim
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi