Could someone quickly show me how to turn specifc questions Red ...

  • csanders_watpac
    Asked on October 19, 2014 at 8:58 PM

    I'm not proficient with CSS so while I could spend time figuring out where, what and how to inject the necessary code ... I could also just ask ... someone who already knows this stuff !

    :-)

    I have a series of "toggle" questions throughout my survey and they all start with "Show/Hide Question "...

    I want to be able to make just those questions stand out visually such as making them Red instead of Blue like all the rest

    They are all the Radio-button class exactly like the example, so if the code could be done based upon the "Show/Hide Question " string that would be optimal rather than having to get each of the control_ID's ... which I can do if I have to obviously.

    It would just be great to do something like;

    For each ctrl in controls where control.class=radio_button
       If Left(ctrl.Title, 18) = "Show/Hide Question" Then ctrl.title.font.foreground=Red
    Next

    Thanks in anticipation
    Regards colin@techtamed.com

    Jotform Thread 445831 Screenshot
  • jonathan
    Replied on October 19, 2014 at 9:52 PM

    Hi,

    I am not really sure that it is possible to affect the style of the elements using Conditional Statement.

    What I am saying is, this sample conditional statement you have

    For each ctrl in controls where control.class=radio_button
       If Left(ctrl.Title, 18) = "Show/Hide Question" Then ctrl.title.font.foreground=Red
    Next

    is not possible as styles are not affected by affected by input since they do not have input value like a an input type element.

    --

    From what I have gathered so far, how about if you just make the input field required/non-required using Conditional Statement. This is very much possible using the form builder.

    There is an option to make a question *Required base on conditions

    Could someone quickly show me how to turn specifc questions Red  Screenshot 20

    OR

    using the long method.. you can create multiple similar questions with different color -- blue or red.

    Then just use the Show/Hide conditional statement base on the selected option (of Radio option field) to show either the Red question or the Blue question

    Hope this help. Please tell us if you need further assistance.

    Thanks.

     

     

  • csanders_watpac
    Replied on October 19, 2014 at 10:00 PM

    Hi there

    Thanks for the immediate response :-)

    No ... I'm not interested in setting the required/not required aspect ... I've got that working.

    I just want to make each of these particular questions RED whereas all the other questions on the form are another color (Blue in my case)

    I notice you said ... "you can create multiple similar questions with different color -- blue or red." ...
    The question is HOW do I choose the color for individual questions on a form?
    I can make ALL controls (questions) a particular color at the Form level but can't see how to set differing colors at a per-control (i.e. per-question) level

    - Regards Col

  • Ashwin JotForm Support
    Replied on October 19, 2014 at 11:03 PM

    Hello Col,

    The question is HOW do I choose the color for individual questions on a form? I can make ALL controls (questions) a particular color at the Form level but can't see how to set differing colors at a per-control (i.e. per-question) level

    Yes it is possible to achieve your requirement by injecting custom css code for every question for which you want to change the font color.  Here are the steps you should follow:

    1. Find out the field name of your question. The following guide should help you:  https://www.jotform.com/help/146-How-to-find-Field-IDs-Names 

    You may also like to check the following guide:  https://www.jotform.com/help/176-How-to-apply-custom-CSS-to-a-particular-field 

    2. Inject the following custom css code in your from to change the font color:

    label#label_1 {

    color: red;

    }

    Please be noted that #label_1 will be changed based on your form's field name. Please check the following screenshot on how to find the field name and add css with the help of "Inspect Element" in the chrome browser:

    Could someone quickly show me how to turn specifc questions Red  Screenshot 20

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • csanders_watpac
    Replied on October 20, 2014 at 12:26 AM

    Thanks so much - that was all I needed :-)

  • Ashwin JotForm Support
    Replied on October 20, 2014 at 12:41 AM

    Hello Col,

    You are welcome.

    I'm very pleased that I was able to help you.

    Do get back to us if you have any questions.

    Thank you!