?
Solved

Getting javascript values and passing them into Perl Variables

Posted on 2003-02-26
4
Medium Priority
?
179 Views
Last Modified: 2010-04-06
Here's my question/problem:

I have a cgi script that parses a text document for a user determined search string and displays the results.  The results page is generated by printing html and javascript code.  What makes this slightly odd is that the results are displayed as draggable links and I want to be able to remember where the user dragged them to.  I have a javascript listener onMouseUp that returns the name and coordinates of the link when it has been dropped, and I would like to be able to set those values to variables in perl, so that I can then store them in a text file (where they could be recalled the next time the page was loaded).  Any suggestions, comments, solutions would be greatly appreciated.  If you would like to see some of the code involved let me know and I will post it here.  Thanks in advance.
0
Comment
Question by:_Dan_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
NetWize earned 400 total points
ID: 8034713
Hi _Dan_,

as you already have the coordinates and the values and a function to get them you might consider this:

<form name="StoredValues" method="POST" action="storeValues.pl" target="_popup">
 
  <input type="hidden" name="top_1" value=""/>
  <input type="hidden" name="left_1" value=""/>
  <input type="hidden" name="top_2" value=""/>
  <input type="hidden" name="left_2" value=""/>
  <!-- Repeatfor all elements -->

 <input type="submit" value="Store Positions"/>
</form>

into your dragging-code you add
function move(n, t, l) {
  eval("document.StoredValues.top_"+n".value='"+t+"';");
  eval("document.StoredValues.left_"+n".value='"+l+"';");
}
Or anything similar wich sets your form-fields accorsing to the position. If the user presses the "Store Positions" you get all the values as parameters in the script called.

Hope that helps,

Jan
0
 

Author Comment

by:_Dan_
ID: 8064812
Thanks for the help.  I think that your suggestion will work.
0
 

Author Comment

by:_Dan_
ID: 8113650
Just a note that I got it up and running perfectly.  Thanks again.
0
 
LVL 3

Expert Comment

by:NetWize
ID: 8113718
cool.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question