RE: [PHP] Saving css state in javascript and passing to php via form submit
- From: user@xxxxxxxxxxxxx ("Tim")
- Date: Fri, 30 Mar 2007 17:10:48 +0200
-----Message d'origine-----
De : Tijnema ! [mailto:tijnema@xxxxxxxxx]
Envoyé : vendredi 30 mars 2007 17:06
À : Tim
Cc : php-general@xxxxxxxxxxxxx
Objet : Re: [PHP] Saving css state in javascript and passing
to php via form submit
On 3/30/07, Tim <user@xxxxxxxxxxxxx> wrote:
vendredi 30 mars
-----Message d'origine-----
De : Tijnema ! [mailto:tijnema@xxxxxxxxx] Envoyé :
Re: [PHP]2007 16:56 À : Tim Cc : php-general@xxxxxxxxxxxxx Objet :
page, when aSaving css state in javascript and passing to php via form submit
On 3/30/07, Tim <user@xxxxxxxxxxxxx> wrote:
Hello all,to hide/show
I have a little dilemna here:
I am using php/css/mysql to generate a hierarchical table of
categories and sub-categories and sub-sub.. Etc..
A screenshot can be found here:
http://www.internet46.fr/mehim/screenshot.jpg
Now i'm also using javascript to hide show blocks of divs
sub categories.. Typical..
My issue is on page reload, i have a form on the same
same page).category is clicked, the categorie info displays and you can
update the info through this form (table and form on
that gets theMy issue comes when i post the data, the page comes back and mycategory tree
folds up which is normal because all divs are set to"display:none;".
I have managed to pass a post/get called lastclicked
clicked element...nodepath of that element and combined with php to generatejavascript
that will unfold the tree and highlight the last
only get thestate of the
I would like to go one step further and save the entire
tree, say several parent categories are unfolded and i click acategory, of
subcategorie to display my form, i want that entire "state" un
unfolded categories to be displayed not just the clicked
course i can get this state and save it in a javascriptarray, but my
issue is when i post my form how do i pass that state datagenerated
by javascript back to the page, to be able to unfold thetree in the state it was previously?
i look up
What are the technologies IF there are any and what should
to find docs that cover this type of datatransfer ie:javascript->php.
Regards,
Tim
I think you want to use sessions for this :)
Ok, i can put the data in the session variable, but i can
"current" state through javascriptblocks that
ie:onsubmit="getstate()"; which would get the id's of the
are set to display:block;session variable?
But in getstate() how do i pass that to php to set that
You could use AJAX to get things from/to PHP, but why should
you? You can use session within javascript too i believe.
Hmm javascript setting server-side session data??
Sounds weird, but i'll look into it..
Nice tutorial thanks for that, i'll look it up, maybe intergrate it rightyet, but yes
Tijnema
ps. Maybe you could also use AJAX instead of submitting forms the
whole time.
In the next version of my framework i would like to, i still havent
quite understood the whole concept, not enough research
i'll be doing that next ;) (you know deadlines, can't sitand read docs all day etc..
Although i'd rather!)
;)
Regards,
Tim
Really, it's not that hard to use AJAX. You might want to
look at www.tizag.com, there it is really easy explained.
It's nothing more then making new request to scripts inside
javascript.
away, would really make my day if i could :))
Regards,
Tim
.
- Follow-Ups:
- References:
- Prev by Date: Re: [PHP] Saving css state in javascript and passing to php via form submit
- Next by Date: Re: [PHP] Saving css state in javascript and passing to php via form submit
- Previous by thread: Re: [PHP] Saving css state in javascript and passing to php via form submit
- Next by thread: Re: [PHP] Saving css state in javascript and passing to php via form submit
- Index(es):
Relevant Pages
|