Skip to main content
Topic: Problem with Modal running Php code before display (Read 1808 times) previous topic - next topic

Problem with Modal running Php code before display

I have a Modal control on a view record page..  So the button is located at the top of the record.

On the page design, I've attached a custom view under the button.  My hope was to run the code in the custom view when the button is clicked.  But the code is running whenever the record view page is loaded..

Is this normal?

Any suggestions welcome..

thanks!

Re: Problem with Modal running Php code before display

Reply #1
@darbdenral‍ if your code executes when the page loads it means you wrote the code to execute whenever the page loads, this has nothing to do with custom view. please check that your code is as you want it to be.

 

Re: Problem with Modal running Php code before display

Reply #2
Exactly, but I would have thought the code would not run until  after the button is clicked and the modal is displayed not when the main view page loads..

Re: Problem with Modal running Php code before display

Reply #3
I was trying to avoid using a custom view but decided to go ahead and do it that way and it worked.

It would be nice to have the ability to link php or javascript code to a button event without sidestepping the design interface.

So, like drag a button  in the design interface and then add the onlclick action code..  Also adding an ID to the button may be beneficial too for jquery,javascript etc.