Currently, one of the two dates is hard-coded to '2011-01-01'. What I would like to do is to replace the static date with the js variable 'eventdate' which appears above the PHP.
Is this possible? How can I use the js date inside the PHP code? Thanks.
Is it possible to create your array in javascript so you can use the other js variables?
I'd like to do this, but don't know where to begin.
How would I move the array to javascript? Is this complicated?
Dobromir Yordanov
I don't think it would be that difficult if it's a static array but unfortunately it's not visible in the code snippet so I can't really tell you. Have you considered moving the event date to php instead? I believe it would be easier in your case. Where do you get that value from? Is it a static (as in hard-coded) or dynamic or user input? Unless it's chosen by the user, I'm pretty sure there is a very easy way to just move it to your php code (or at least copy its value). Notice that I'm not saying to get it from JavaScript to PHP but to get it to PHP way before it reaches JavaScript. Think if that's possible with your setup.
DanielAttard
ASKER
Thanks again cp.
Agreed, I would prefer to move the event date to php, but how to accomplish this? Currently, the event date is set in javascript with this:
I thought about your question, whether it is possible to "get the date value to PHP way before it reaches JavaScript", and I don't think that this is going to be possible. The date changes from time to time by the user, so I need to be able to pass that date value into my PHP at different times with different values. Not sure what to try next . . .
xx
Well that doesn't work so it's time to try to move the array and loop to JavaScript for which we would need to take a look at a bigger chunk of your PHP code. If that also fails you have only one solution - refreshing page or asynchronous request, i.e. Ajax. I'll try to help you tomorrow but I don't know if elvin66 or someone else wouldn't like to help you meanwhile... I'll check back and help you if still needed. Take care!
I'd like to do this, but don't know where to begin.
How would I move the array to javascript? Is this complicated?