Default the value of a textbox from another textbox upon checking a checkbox using "Enter Options"
Last Post 08-21-2009 11:48 AM by David To. 6 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
ABUser is Offline
going with the flow
going with the flow
Posts:62
Avatar

--
08-19-2009 01:55 PM

    Hello!

    I'm trying to default the value of a textbox from another textbox after a user checks a checkbox.  So, the value that I have are:

    Initiation Question:  Check this box is assigning same school as chosen above

    Execute event for any response:  checked

    Initiation Response:  Unchecked

    Affected Question:  School assigned

    Affected Question New Default:  "Enter Options" is checked and a value of $(applTxtSchoolName)

    Can tokens be used in the Affected Question New Default?  Is so, what's the syntax?

    Thanks.

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    08-20-2009 07:11 AM
    Hi, this might be easier using javascript. If checkbox is checked, set the default value of textbox2 based on the value of textbox1. This logic / javascript coding would work more efficiently than using question event for your scenario. -- David
    ABUser is Offline
    going with the flow
    going with the flow
    Posts:62
    Avatar

    --
    08-20-2009 01:21 PM
    So, here's my js. How do I invoke it, or where do I put it?

    function assignSameSchool(){
    var objChkBox = document.getElementById('applOptOfcPickSameSchool');

    if(objChkBox[0].checked)
    var tboxSchoolByAppl = document.getElementById('applTxtSchoolByAppl')
    var tboxSchoolAssigned=document.getElementById('applTxtSchoolAssigned')
    tboxSchoolAssigned.Value=tboxSchoolByAppl.Value
    else
    tboxSchoolAssigned.Value="";
    }
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    08-21-2009 05:53 AM
    HI, try this out instead:
    Let's say your fields shortnames are:
    1) $(checkbox1)
    2) $(textbox1)
    3) $(textbox2)
    Your javascript (which you put in two places);
    a) under Module Configuration / Custom Javascript / Initial Javascript (when page loads)
    b) under Client side event for the checkbox1 / advanced field options
    Javascript would look like:
    if $(checkbox1) {$(textbox2) = $(textbox1);}
    -- try this out and see if it works for you. -- David
    ABUser is Offline
    going with the flow
    going with the flow
    Posts:62
    Avatar

    --
    08-21-2009 08:02 AM
    I input the js you provided in both places as you requested but to no avail. Here's a copy of my form. Thanks.
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    08-21-2009 08:11 AM
    Can you export your form to www.betasprings.com (username: host,password: dnnhost) and type in the URL/tabID here so I can take a look at it? -- David
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    08-21-2009 11:48 AM
    Has been resolved. Changed javascript to be:
    if ($(checkbox1)) $(textbox2) = $(textbox1)


    ---
  • 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