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

 [Resolved] After Execute insert doesn�t run

Print topic Send  topic

Author Message
CodeChargeMVP

Posts: 473
Posted: 03/10/2011, 7:28 AM

Hi,

this code is placed on the after execute insert:

echo "<script language='javascript'> alert('the user has been successfully submitted.')

</script>";

and it worked fine in the past.

I�ve made some changes to the form as changing some object from one type to other,hide some rows programmatically,but I don�t really know why the message has stopped working.

�Any Suggestion?

Bettween the message is only showed when there´s an insert and it produces an database error.

Thank you very much in advance.

_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
jjrjr2


Posts: 131
Posted: 03/13/2011, 6:04 AM

That Could never have worked..

CCS is a template driven system.

All that would do in any CCS application is echo that HTML on the screen not execute as HTML

If U want that to work in a CCS Application.. This is what U have to do.

In some white space create a label in the HTML Head (or any place U can create a label wher U can put Javascript.)

Call it maybe alert.

In AfterExecuteInsert do this Custom Code

$Container->alert->SetValue("<script language='javascript'> alert('the user has been successfully submitted.') </script>");

That Should work..

If not Try just putting in the HTML at some white space
{alert}

Then in after execute insert put Custom Code:

global $Tpl;
$Ttp->SetVar("alert",
("<script language='javascript'> alert('the user has been successfully submitted.') </script>");


Finally if that does not work
(The reason this differnet methods is I cannot remember if these functions work on Both Sides of a transaction in CCS Code.. If the above 2 do not work.. Tghis one definitely will)

In the AfterexecuteInsert code put Custom Code
CCSetSession("ALERT","YES");

Put into your HTML a label called alert someplace in the code where Javascript would go

Now in beforeshow do Custom Code

if(CCGetSession("ALERT","")){
$Container->alert->SetValue(("<script language='javascript'> alert('the user has been successfully submitted.') </script>");

CCSetSession("ALERT","");
}

Does that make sense.

Let me know

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message
jjrjr2


Posts: 131
Posted: 03/13/2011, 6:13 AM

Hi again..

U knowin thinking about it I may have been able to work in the past is U just happened to be lucky and it echoed in a place where javascript could execute.

Afte rchanging your form & record stuff.. The javascript probably got echoed in an inappropriate place for javascript.

The method described above would be the proper way to change HTML in CCS.. Not an Echo Statement..

Make sense again.. LOL

Let me know.

John

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 03/14/2011, 7:07 AM

Hi,

This is the result from your first solution...

Notice: Undefined property: clsRecordusuarios::$alert in C:\Program Files (x86)\EasyPHP 3.0\www\infoaod\informantes\mantenimiento_interv\usuario_events.php on line 39

Fatal error: Call to a member function SetValue() on a non-object in C:\Program Files (x86)\EasyPHP 3.0\www\infoaod\informantes\mantenimiento_interv\usuario_events.php on line 39


_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 03/14/2011, 7:15 AM

HI,

Your second solution neither show an error message.



_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 03/14/2011, 7:18 AM

Hi,

I got a question,

¿Have you make this work or you speak castle in the sky?

Second question,

¿Have you ever work with CCS?

Thank you very much in advance.


_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
jjrjr2


Posts: 131
Posted: 03/14/2011, 1:22 PM

Answer to your 1st question is Yes

Answer to your second question is Yes

Do not know what U are doing..

LOL

May be just forget it Just trying to help..


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 03/15/2011, 3:56 AM

Ok,

No worries,

¿Would you mind give me a solution which works?

Thank you very much in avance.

Quote jjrjr2:
Answer to your 1st question is Yes

Answer to your second question is Yes

Do not know what U are doing..

LOL

May be just forget it Just trying to help..



_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
jjrjr2


Posts: 131
Posted: 03/15/2011, 4:16 AM

Nope
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 03/29/2011, 2:44 AM

¿anybody can take a look at this?
_________________
Best Regards
Entrepeneur | NT Consultant
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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