Call list(...) multiple times in same page...

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 29, 2011   (RSS)

Re: [rcrofoot] Call list(...) multiple times in same page...

By Jason - September 29, 2011

Hi Rick,

The problem here, I think, is the use of javascript. PHP is a server side technology, which means it is executed by the webserver before it ever gets sent to your client's browser. Javascript is a client side technology, so it is executed by the client's browser. So in your script, your PHP statements are being executed before the page is sent to your client.

There isn't a way to have a javascript function that executes PHP on the client side. The closest you can get is to use jQuery, but that still just makes a call to the server to execute the PHP there.

The best approach here, I think, is to have your form refresh you page with each selection, then execute a different getRecords call depending on their selection.

Hope this helps get you started. Please let us know if you run into any difficulties.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/