Dhtml to perl

I am dynamically reassigning the positions of some graphics on a web page with the mouse but after I am done I would like to be able to send the position coordinates( with a submit button) to a perl script to be stored so that these rearranged pages could be reloaded by calling the script to dynamically output the page with the coordinates which had been stored previously. Is this doable?
LVL 3
guadalupeAsked:
Who is Participating?
 
jbirkCommented:
This might be do-able, but it depends on when you want the co-ordinates to be submitted.  On some event or at a time interval?  Will this submitting refresh the screen or does it need to happen in the background (invisible frame).  Also, you will probably need to record the IP address in the cgi script so you know which saved coordinates to use.  Then when the user loads the page it will check to see if their IP address accessed this page within the last xx minutes (whatever the time period is) and loads the page with the dynamic locations set to what was saved.
And saving them would involve an IP and date stamp followed by the list of coordinates.

This is all do-able, but can be very complicated, and it depends on you knowledge of Perl as well (can you do this stuff in Perl?)  I can help with Perl, but you might get better help for that aspect via the cgi section.  I CAN do a good job in helping you with the rest of setting this up.

Good luck!
-Josh
0
 
guadalupeAuthor Commented:
Edited text of question
0
 
sybeCommented:
It seems to me not so hard, although I dob't know enough of DHTML to answer it easily:

A perl script, means that a form is submitted, right ?

So in the form there should be some hidden fields, each for an image position.

The "onSubmit" call a JS-function that puts the cureent positions of the images in the hidden fields, and then the form is submitted.

When perl returns some values, it includes the values for "current position" that it receives.

But...... this all is very complicated, if you want to same page to re-appear after a submit, then it's better to use a "hidden frame" to which the form is submitted. It leaves the current page untouched, and you could evt. process the return data using javascript.

0
 
guadalupeAuthor Commented:
Thanks for the responses.  Yes it is a tricky one but not as much as you think.  The point is to allow people to "save" a page setup and the recall it at a latter date and only upon specific request.  Therefore a user name/ip address will probably be the way to go for storage/retreval of the data.  The real stubling block for me was the passing of the x,y to the script but as suggested I think the way to go is hidden fields with a JAVA script which assigns the x,y coordinates into the hidden name/value pairs.  This JAVA could be run at the onClick event of the submit button which should process before the action executes (i.e. the actual submission of the names/values to the script)  While I do feel confident that I can pull it off I would love any feedback especially pitfalls to watch for.  Also please let me know if anyone wants the final resulting script.  (though you may have to wait as other design priorities call)  Thanks Jason  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.