jquery - JavaScript Query - Using AND & OR with Radios, Checkboxes and Text Fields to enable form elements -


Please see the code I already have. My problem is that I need to use a text entry and radio station in the text field to enable other radio, checkboxes, and text fields. So far, I have been able to enable radio, checkboxes, and text fields using only radio option 1 or radio option 2.

This can help you people and you can understand more than I mean.

HTML:

  & lt; Div class = 'conlabel' & gt; Have you started the business yet? & Lt; / Div & gt; & Lt; Table width = "100" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "example" value = "yes" id = "example_0" required /> Yes & lt; / Labels & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "example" value = "no" id = "example_1" required /> No & lt; / Labels & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; Br> & Lt; Li & gt; & Lt; Div class = 'conlabel' & gt; If yes, enter business name: & lt; / Div & gt; & Lt; Input type = "text" id = "field1" name = "field 1" placeholder = "" disable / & gt; & Lt; / Li & gt; & Lt; Br> & Lt; Li & gt; & Lt; Div class = 'conlabel' & gt; If not, then: & lt; / Div & gt; & Lt; Input type = "text" id = "field2" name = "field2" placeholder = "" disable / & gt; & Lt; / Li & gt; & Lt; Br> & Lt; Li & gt; & Lt; Div class = 'conlabel' & gt; Enter the business start date (if enabled, business = yet = yes + business name = notnull: & lt; / div & gt; & lt; input type = "article" id = "field3" name = "Field3" placeholder = "" disabled ">  
  • <; ARTR (" disabled ", true); if ($ (" $ "," $ "," $ "($" (" Remove $ ("# field 1"). $ ("# Field 1"). Remove ("disabled"); $ ("# field1"). Focus ();} and if ($ ("$ (" # 2 ") $ ("# Field2"). $ ("# Field2"). Remove Entry ("Disabled"); $ ("# field2"). Focus ();}});})

    In this example, Theode is currently enabled and the field 1 focuses on or field2, depending on whether the section radio- example_0 or example_1.I did not understand if they select Yes (example_0) And then enter a business name in field1 how to enable field 3.

    Hope this is clear from my last attempt. Thanks for your help!

    check the value of field 1 when you leave the cursor Mitigation is required, try it: ($ ( "# Field 1"). (If ($ ("# field1"). (Val ("# field1"). ()! == "") {$ ("# field3"). RemoveAttr ("disabled");}}});



  • Comments

    Popular posts from this blog

    excel vba - How to delete Solver(SOLVER.XLAM) code -

    github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

    ios - Replace text in UITextView run slowly -