Hey
Let me see how I describe this....
I have a textbox (inside of a form) and that form also has a button that calls a Javascript function that does some unrelated stuff. This is all inside of Lightbox. I want to be able to type in text in that textbox, save it (somehow), click the button that not only calls the JS function but closes the Lightbox and still have that valued store.
Now I know that PHP is server side and JS is client side so I would have to somehow pass it to the server and store it there temp. Several answers come to mind (which I dont know how to implant at all):
1: AJAX
2: Cooke/session/etc.
As for 1, I think it is the best way but I have no idea how to implant something as simple as this. As for 2, Ive tried but it just doesnt work....
2:
Using a cookie (Yes, I know it is a overkill for this) (This is my Lightbox):
//this code is in a JS function inside the Lightbox called saveAndClose
document.cookie="cookiename=" + document.getElementById('cookiebox').value;
The HTML of the principal page (the LightBox is in a iframe I believe which is opened from the principal page emulating a popup of sorts) is:
<form name="save" id="save" action="saveAndClose">
<div id="actions">
<input type="text" id="cookiebox" name="cookiebox"/>
<input type="submit" id="saveAndClose" name="saveAndClose" value="OK" title="Final"/>
</div>
</form>
And finally the PHP side of things:
<?php echo $_COOKIE['cookiebox']; ?>
Ive also tried with " " and without ; incase my sintaxis was incorrect.
So that a bit where I am at right now. Basically I want a JS textbox's value to be able to be seen in all of the website, to sum it up and make it easier.
Thank you!