This topic is locked

Can checkbox be set to required?

2/20/2008 4:13:27 AM
PHPRunner General questions
J
jack knowles author

Hi all,
Quick question!!!
I have a checkbox call "terms". Is there a way to set this field to be required, so that the user must check it before they can continue to save there record on the edit page.
Thank you
JK

J
Jane 2/20/2008

Hi,
to setup field as required check off corresponding check box on the "Edit as" settings dialog on the Visual Editor tab.

R
richardbeaumont 5/17/2008

I wanted to do this - but the option is not there for the checkbox type.
I want to have a required 'accept terms and conditions' checkbox on the registration page.
thanks
Richard

Hi,

to setup field as required check off corresponding check box on the "Edit as" settings dialog on the Visual Editor tab.

S
steveh 5/19/2008

You can't really have a checkbox as required as the unchecked is one of the values.
You'd need to check the value in the save record event and reject with a popup.

R
richardbeaumont 5/19/2008

You can't really have a checkbox as required as the unchecked is one of the values.

You'd need to check the value in the save record event and reject with a popup.


Okay thanks - how do I do that?

J
Jane 5/20/2008

Hi,
use BeforeRegister event for that.

Here is a sample:

if (!$userdata["FieldName"])

{

?><script>

alert("error");

</script><?php

return false;

}
return true;