CodeCharge Studio
search Register Login  

Visual PHP Web Development

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 modify onclick event with php

Print topic Send  topic

Author Message

Posts: 1
Posted: 01/19/2014, 9:28 AM

Hello guys.
I need help.
I need (after a 'if' choice) to apply or not a onclick event call to an element (image) in a grid.
The best for me is to use the Beforeshowrow event and add some php code like this :

... if ( grid->image->getvalue()=="change") then add to image "onclick='myfunction();'"

else do nothing;

some suggestions??

thanks in advance


View profile  Send private message

Posts: 36
Posted: 01/20/2014, 5:41 AM


Maybe you can apply a client custom code on the onclick event of the element and then start your condition in the javascript code.

Assign feature >> Client custom code >> start event on the click of your element.
In the javascript custom code retrieve the the value of the element
$(this).attr("href") or $(this).attr("id") or $(this).attr("yourowntag");
test the value and start your function.

View profile  Send private message

Posts: 220
Posted: 01/20/2014, 12:34 PM

Or if you want to be really smart, you can on server-side add some class to your image like:

<img ... class="clickable"> or <img ... class="notclickable"> then in JS program function that clicks basing of the link class.

I would use jQuery to help me in this task.
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

Web Database

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

Home   |    Search   |    Members   |    Register   |    Login

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