Can't set value of the Label question in JavaScript
Last Post 09-17-2013 01:11 PM by Chad Nash. 5 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
TonyUser is Offline
going with the flow
going with the flow
Posts:45
Avatar

--
08-29-2013 02:54 PM

    Hi,

    I have a simple form with a few text fields and 1 label.  In the onblur event of one of the text fields I have the JavaScript code:

    $(Label) = "Test";

    However the value of the label does not change.  I want to have some information displayed for the user based on javascript code logic.  How do I make this work? 

    Thanks,
    Tony

    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    09-06-2013 12:18 PM
    Hello Tony,

    You may want to apply the following JavaScript instead:
    ------------------------------------------------------------------------------------

    var LabelID = $(Label_FieldID);

    document.getElementById(LabelID).innerHTML = 'TEST';

    ------------------------------------------------------------------------------------

    If this doesn't change the label for you, you may want to change the Question Type from "Label" to Text/HTML.

    Then add an HTML SPAN tag with an ID. You can then use the same JavaScript method above to re-label this tag.

    Please let me know if this helps.

    Thanks,

    Ryan
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    09-07-2013 07:32 AM
    Ryan,
    That is Awesome! It works perfectly.

    Thank you!
    Tony
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    09-09-2013 04:59 AM
    Great to hear.

    Please let us know if you ever have any questions.

    Take care.

    -Ryan
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    09-16-2013 03:20 PM
    Oops, I spoke too soon. I can set the value OK as per your previous reply, however the Dynamic EMail message event does not display the value in the email. Is this by design and if so how do I compensate for it?

    Tony
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    09-17-2013 01:11 PM
    Hi Tony - In this case you need to create two fields... One field has the act value in it (this is using a field with the field type of "Hidden") and then the other field type would be the label or HTML field etc... Every time you set the label or HTML you would then also set the hidden field type.


    Thanks,

    -Chad


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