libol
Posts: 12
|
| Posted: 03/25/2005, 5:39 PM |
|
i want add custom error message when user submit form failed
i do like this,but failed,error message not show
//NewRecord1_Button_Insert_OnClick @6-07835AFE
function NewRecord1_Button_Insert_OnClick()
{
$NewRecord1_Button_Insert_OnClick = true;
//End NewRecord1_Button_Insert_OnClick
//Custom Code @11-FF3FD3DA
// -------------------------
global $NewRecord1;
// Write your own code here.
if(CCGetFromGet("name","")==""){
$NewRecord1->Errors->addError("afdsfafd");
}
// -------------------------
//End Custom Code
//Close NewRecord1_Button_Insert_OnClick @6-A9FC55FD
return $NewRecord1_Button_Insert_OnClick;
}
//End Close NewRecord1_Button_Insert_OnClick
please tell me why,thank you
|
 |
 |
peterr
Posts: 5971
|
| Posted: 03/25/2005, 5:43 PM |
|
I think that you have to use OnValidate event as specified in the documentation: http://docs.codecharge.com/studio/html/ProgrammingTechn...Validation.html http://docs.codecharge.com/studio/html/ProgrammingTechn...Validation.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
libol
Posts: 12
|
| Posted: 03/25/2005, 6:15 PM |
|
can not use in OnClick function?
|
 |
 |
Nicole
Posts: 586
|
| Posted: 03/28/2005, 1:18 AM |
|
Libol,
You cannot assign custom error message to Errors collection from button’s onClick event. Use onValidate event as suggested.
_________________
Regards,
Nicole |
 |
 |
|