Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Getting javascript values and passing them into Perl Variables

Posted on 2003-02-26
4
Medium Priority
?
182 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_
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

564 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