Skip to main content
Participant
July 28, 2017
Answered

How to convert an textfield in a must textfield after the checkbox is selceted with true/yes?

  • July 28, 2017
  • 1 reply
  • 598 views

Example: If someone like to subscribe to an Newsleatter, they must give me the emailaddress.

(Checkbox) Newsleater? Yes! =

(TxTField) Emailaddress, must field!

(Checkbox) Newsleater? No!

(TxTField) Emailaddress, not must field

This topic has been closed for replies.
Correct answer try67

Use this code as the Mouse Up event of your check-boxes:

this.getField("Emailaddress").required = (event.target.value=="Yes");

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 28, 2017

Use this code as the Mouse Up event of your check-boxes:

this.getField("Emailaddress").required = (event.target.value=="Yes");

leoandAuthor
Participant
July 28, 2017

Hi try67

thank you very much for your answer. It works with Mouse Up event. Is there also a code by enable field event?

also after they click on yes, the email field will bi required.

thanx

try67
Community Expert
Community Expert
July 28, 2017

I don't quite understand what you mean... If it works with the Mouse Up event, why change it?