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!

Radio Buttons and Javascript question
Last Post 05-03-2010 11:12 AM by BSquared. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
BSquaredUser is Offline
river guide
river guide
Posts:89
Avatar

--
04-12-2010 04:25 PM

     Time for an odd question.  I'm developing a form where people can select a template to be used in printing a flyer.  I was going to have a list of 6 individual radio buttons with a hidden html field between each that only appeared as the radio button or label was selected.

    However, since the radio buttons don't work like I had envisioned.  In doing radio1-> HTML1, radio2->HTML2, etc, each radio button acts independently so that, in my case, on can choose all six templates instead of just one.  I tried to turn the selections off with javascript but getElementById and getElementByName didn't work for me.  Which is perfectly normal as they all have different names but not suitable for my purposes.

    I also tried a group of 6 buttons and tried to get my html question to park to the right of the radio buttons using the 'Add field to previous row' option but the html question won't budge.

    So, i guess the easiest question is can I control the button state from within Dynamic forms with javascript and if so, how.  Or is there another way to get at what I want?

    Here's an image of what I'm looking for:  Thanks in advance...

    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    04-12-2010 05:47 PM
    Just FYI, here's the client side script I'm using for option 1 to option 2 as a test. I've tested it offline and it works fine but not in df.

    onClick="document.getElementById('dnn_ctr809_DynamicForms_Responses_d7121192-be09-4456-8519-f518ad6b8784_0').checked = false";
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-13-2010 07:16 AM
    HI, I still do not quite understand what you are trying to achieve. If you have six separate radio button, so if they choose a particular radio button, you want to hide the rest of the radio buttons? IF so, can't you use question event for this purpose? If they choose anything from Radio 1, unhide the HTML field associated with Radio 1 and hide all the rest of Radio 2 - Radio 6? Wouldn't this achieve what you want as opposed to using client side javascript to hide / unhide the elements? -- David
    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    04-15-2010 02:53 PM
    Hmm - I thought I posted a response last night - had some demo code too - oh well. Basically, I'm trying to get the separate radio buttons to behave like the grouped ones. I wanted to reveal the html block beneath each button with an onClick and make sure that all the other radio buttons got cleared at the same time.

    While persusing your excellent examples this afternoon, #13 proved to be a treasure trove of ideas and I think where I was going wrong with my test was that I did not prepend the javascirpt commands with the shortfield name (I think that's what the examples said). Anyway I found some excellent examples and am inspired for this next form I need to build. One additional question - the onFocus highlights you're using on the fields - it that a setting in the module or some additional client side coding? I reallly liked the behavior of the required fields with the red arrows too - something I'll definitely be cloning.
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    04-21-2010 10:31 AM
    Hi... A couple comments on this post...

    1. I also believe one option is that you can use HTML within the question option text. So you might try that directly instead of having multiple radio button questions... So basically you could copy / paste the HTML you are wanting to display in the actual question option text property.

    2. Yes... The way this works is described in the tutorial and also in the user guide 113 and 114... The key the short field name and including text in it such as 'FirstNameonkeyup' instead of 'firstname' etc...
    http://www.datasprings.comuserguide...rGuide.pdf


    Here is a quick blurb:
    Client Side Events are processed based on fields onblur events (except where noted below). For
    textbox fields, you might want to process client side events in situations besides onblur. For these,
    you can use the following keywords within the fields short field name.
    • onclick – Adds the client side event to the textbox onclick event
    • onfocus – Adds the client side event to the textbox onfocus event
    • onkeypress - Adds the client side event to the textbox onkeypress event
    • onkeydown - Adds the client side event to the textbox onkeydown event
    • onkeyup – Adds the client side event to the textbox onkeyup event


    Hope this helps!

    -Chad
    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    05-01-2010 07:13 PM

    After a lot of reading, I'm very close to where I need to. I'm trying to use something like Demo 6 with the help toggle.  In the question, I'm passing the ID of the radio button to a function and calling funcRadioCalc to get the value.  Then, using that value, I can write the innerhtml to do what I need.

    However, I still have a problem.  When I alert out the value, I get two event and am unable to get a single value to return.  For instance when I load the form and click on the first radio button, the alert says 'undefined' - click on OK and then is says '1' (which is correct).  Click on radio two and the first alert says '1' and the second '2' and so on.  I've tried checking the value and then alerting out some text so I could see it but with similar results.

    Any idea how I can make this only a single event?

    The code on the queston is: showOptions($(flyerOptions_FieldID))

    and the function looks like:

    function showOptions(obj) {

    optionValue = funcRadioCalc(obj);

    if(optionValue == '1') {

    alert('One');

    } else if(optionValue == '2') {

    alert('Two');

    }else if(optionValue == '3') {

    alert('Three');

    } else if(optionValue == '4') {

    alert('Four');

    } else if(optionValue == '5') {

    alert('Five');

    }

    }

     

    BSquaredUser is Offline
    river guide
    river guide
    Posts:89
    Avatar

    --
    05-03-2010 11:12 AM
    Never mind - figured it out. I was using alerts to monitor the values. The first alert was from the onclick. The second alert was from focusing on the second radio button and an initiating the onBlur on the first field. Turns out this is only an issue with an alert. Setting a value on another field works just fine as the onClick overwrites the onBlur.
    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