Forums

Adding an "onLoad" JS function to a CC

fhe 23 Oct, 2009
Hi everyone,

is it possible to add a Javascript function that has to be called any time the page is loaded? I mean: I need this to show/hide parts of the form depending on a variable's value when the page is loaded or reloaded.

TIA
GreyHead 23 Oct, 2009
Hi fhe,

Yes it is, Google and you'll find the code.

But if you know the variable value when the page loads you can do this on the server in PHP much more easily. Just use a PHP switch or if statement in your form HTML.

Bob
fhe 23 Oct, 2009
Yes I can do this in PHP but first I need to understand what happens when the Search button is pressed. Can you confirm me that it is just a call to the page itself in which the SQL restriction is set?
GreyHead 23 Oct, 2009
Hi fhe,

I'm not sure about *just* but it is a normal page re-load.

Bob
fhe 23 Oct, 2009
Thanks a lot Bob! I've tried as you suggested and it is working fine!

Francesco
This topic is locked and no more replies can be posted.