html - hide or display field based on the checkbox value. if check box is selected display the label and field if not selected hide itin playframework -


I have a form where I want to show some fields based on the value of the checkbox.

Below is the code in my view

  @checkbox (userModelForm ("isstudent"), '_label - & gt; & lt; font color = "gray" & gt; ; Student & lt; / font & gt; '_showConstraints - & gt; false)   

If this checkbox is selected I need to show the following input text if it does not hide @inputText (userModelForm ("Student ID"), '_label - & gt; font color = "gray" & gt; Student ID & lt; / font & gt; Class - & gt; "form-control", '_help - & gt;' Realtors, please enter your student ID, '' Terror -> UserModelForm.globalEr Ror)

thanks

I have a in a div I'll put @inputtext , which is hidden,

Use Javascript to show / hide it. If you have many hidden divisions, then I will apply the style to a .css file (inline is not very good)

& Gt; Students & lt; / font & gt ;, '_showConstraints -> False,' id - & gt; "show-student-checkbox")

Take a look at this Cast , Then you if tests will have to be ignored by the devils.

Take a look at this, if you are unsure of hiding + non-violence

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -