RadioButtons Validation

Discussions about Forms Designer for SharePoint 2010.
Locked
User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

11 Sep 2014

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


Thanks!

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

12 Sep 2014

Hi,

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

User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

12 Sep 2014

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.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

15 Sep 2014

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

Code: Select all

if (fd.field('ChoiceRadio').value() == -1) {
    alert('Please, make a choice');
    return false;
}
return true;

User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

16 Sep 2014

That worked great. THanks for your help.

lijupnandanan
Posts: 16
Joined: Mon Apr 11, 2016

21 Sep 2016

Hi

I get radiobutton value from this

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


but how can I get radio button text?

YuriyMedvedev
Moderator
Posts: 33
Joined: Wed Sep 21, 2016

22 Sep 2016


Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests