RadioButtons Validation

rss

Posted by schuess - Sep 11 ’14 at 02:11

How can I can i complete JS validation for a field of Type RadioButtons?

 

Thanks!

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 26 days
    #1 by Dmitry Kozlov Sep 12 ’14 at 03:47

    Hi,

    What kind of validation do you need to implement? You can make field mandatory in its settings: List settings -> Columns.

  • schuess
    schuess
    Member
    Member for: 5 years 10 months 22 days
    #2 by schuess Sep 12 ’14 at 09:43

    I know I could just make all of the fields i wanted madatory from the list column settings, however i was going down a path of doing all of my field requirements with JS.

     

    I have a field of type Radio that has 2 choices. I just want to make sure a choice is made.

     

     

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 26 days
    #3 by Dmitry Kozlov Sep 15 ’14 at 09:56

    [#2]: OK, I see. Here is the code you should add into onsubmit handler:

    if (fd.field('ChoiceRadio').value() == -1) {
        alert('Please, make a choice');
        return false;
    }
    return true;
    
  • schuess
    schuess
    Member
    Member for: 5 years 10 months 22 days
    #4 by schuess Sep 16 ’14 at 09:16

    That worked great. THanks for your help.

  • lijupnandanan
    Member
    Member for: 3 years 8 months 3 days
    #5 by lijupnandanan Sep 21 ’16 at 11:17

    Hi

    I get radiobutton value from this

    fd.field('FieldName').value()

     

    but how can I get radio button text?

  • Yuriy Medvedev
    Yuriy Medvedev
    Moderator
    Member for: 3 years 3 months 17 days
    #6 by Yuriy Medvedev Sep 22 ’16 at 06:05

    [#5]: http://forum.spform.com/forms-designer-for-sharepoint-20/nake-fields-mandatory-using-a-radio-button-36630/#msg4 answer is here

Displaying 1 to 6 of 6 messages