Buttons?

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
peters
 
 
Posts: 64
Joined: Thu Sep 28, 2023 12:29 pm

Buttons?

Post by peters »

I am still new to using this web builder, but got most of the functionality and options under by belt now.
I have still one remaining thing I just don't understand. I'll provide for you the functionality I am trying to figure out and it involves a basic button dropped on a webpage.
I have no form on the webpage just a textarea displaying some information from a record I want to delete.
I have 2 buttons, Yes to delete or No to cancel deletion. User selects No if he/she does not want to delete the record and the button is set to link to the previous webpage . . . so no problem here.
The button that is Yes is my issue. All I want to do is click the button and delete the record. I am not using submit as no form involved and all I want to run is a SQL-statement . . .
Delete FROM deliveries WHERE id = 64
I am looking at the button's onclick event and I do not see anyway to add in any custom PHP or Javascript.
Is there any way to simple run any custom script from the buttons onclick event?
User avatar
Pablo
 
Posts: 23267
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Buttons?

Post by Pablo »

This is not specific to WWB, but more web programming in general.

Firstly, you will have to write a PHP script that deletes the record.
Secondly, you can to trigger the script via a link or Javascript/AJAX.
peters
 
 
Posts: 64
Joined: Thu Sep 28, 2023 12:29 pm

Re: Buttons?

Post by peters »

Hi Pablo,

Yep, I was pondering at the event tab as to why one could not have an option for entering in a custom function call as currently you only have 16-17 javascript presets that you can pick from. Seemed to me this would be a good entry point to say pick a new event, select the onclick event that then allow the developer to make a call to a custom javascript function.
Just seems strange to me you have the Events tab and you have all the different events such as onclick, ondblclick, ondrag, etc.; can pick Action: javascript; but no way to enter in a custom javascript call.
Maybe a thing that would be better suited in the suggestions for the next upgrade.

I looked at a work-a-round that I just tested and it is working fine. I set the button to Link to: File. Then selected my custom Filename: that is an external php file and in it my required PHP server-side commands with embedded javascript I wanted to run. So this is kind of what I was looking at doing with the onclick event.

Pete,
User avatar
Pablo
 
Posts: 23267
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Buttons?

Post by Pablo »

You can use events to call a custom JavaScript function.
You can enter any valid code, in the input field!

Image
peters
 
 
Posts: 64
Joined: Thu Sep 28, 2023 12:29 pm

Re: Buttons?

Post by peters »

Ok... super that is what I wanted to verify!
Thanks
Post Reply