Hello friends,
I am using silverstripe 2.3.0 rc1
I want to use custom validation on the phone field, please guide me in the same, I want to use javascript for validation
here is code snippet
function Form() {
return new Form($this, "Form", new FieldSet(
// List your fields here
new TextField("ContactPerson", "Contact Person"),
new EmailField("Email", "Email address"),
new DropdownField("Reason", "Your Reason", array(
"Sales" => "Sales",
"Marketing" => "Marketing")),
new PhoneNumberField( $name = "PhoneNumber",
$title = "Phone Number "
),
new TextareaField( $name = "Remarks",
$title = "Remark",
$rows = 8,
$cols = 3)
), new FieldSet(
// List the action buttons here
new FormAction("SubmitAction", "Submit"),
new ResetFormAction("ClearAction","Clear")
), //new CustomValidator($javascriptCode)
//new CustomValidator("<script>window.open('new.html')</script>")
//new ContactFormValidation()
new RequiredFields("ContactPerson","Email","Reason","PhoneNumber" )
);
}
reply become appreciable.
please hurry..
Thank You