1778 Posts in 581 Topics by 555 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2517 Views |
-
Custom validation

11 February 2009 at 8:58pm
Hello friends,
I am using silverstripe 2.3.0 rc1I 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 -
Re: Custom validation

3 May 2009 at 2:24am
I need help as well figuring out how to disable/enable some fields according to the state of a radio button.
Example:
Are you over 18? () Yes () No
If No:
Parent's Email: __________________________-------------------
Why does it seem that 70% or more of good questions on this forum go unanswered? I think this forum's lack of quick user help is going to hurt SS. -
Re: Custom validation

19 May 2009 at 4:43am
Hi Dipak,
Hey did you ever get the customvalidation to work with the javascript?
I have the exact same situation, but can't figure it out to save my life.
What did you end up doing?
I simply want to add to the required field validation and add a validator for a phonefield to be at least 10 digits in length.
Let me know if you solved this,
Terry
-
Re: Custom validation

8 July 2009 at 8:16pm
Hi Terry, Dipak,
Did you guys find a solution for that validation and your problems?
Please let me know.
thanks
angelo
| 2517 Views | ||
|
Page:
1
|
Go to Top |


