CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 how to add custom error message

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
libol

Posts: 12
Posted: 03/25/2005, 6:15 PM

can not use in OnClick function?
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.