Hello Steve,

Well, there is no way you can find it out. coordinates are not
transmitted with the data. coordinated are purely client side values.
There are few tricks you can use, though. All I can think of are
javascript-based.

For example, you can catch form's onsubmit event, or Submit button's
onclick, and iterate through form elements, collecting elements' position
properties. I am sure, that cross-browser compatibility will be really
HARD to accomplish.

But for IE6(maybe even lower) you can use the following snippet:
function getCoordinates() {
  for (i = 0; i < form1.length; i++) {
    // of course, instead of displaying coordinates you should do smth
    // useful :-), like storing them in a type="hidden" field.
    // apart from .name, .offsetLeft and .offsetTop you might use
    // .type property, just in case there are hidden fields, that you
    // don't need to display
    alert(form1[i].name + ", left: " + form1[i].offsetLeft + ", Top: " + 
form1[i].offsetTop + "\n");
  }
}
...
<form name="form1" onsubmit="getCoordinates()">

If you don't have control over originating form, then you will have to
use some more tricks, like loading HTTP_REFERER inside <iframe> with
width and height set to 0 (to conceal it from user), and trying to
execute the same snippet on the loaded form.
...or, you can just open remote file, parse it, and display to the
user.

HTH,
German

SM> Thanks German, but I think I wasn't clear enough in my question. I don't
SM> need to know the order of elements, but their actual x,y coordinates on the
SM> submitted page. I am trying to reproduce the form which was submitted.

>> AFAIK, form elements are sent in the order they appear on a page,
>> meaning that the topmost will be sent first.
>> 
>> When using GET method you can just parse QUERY_STRING.
>> If you are using POST method, you will have to parse RAW_POST_DATA.
>> But in PHP $_GET and $_POST array are populated in that order already.
>> So you can just tarverse $_POST and $_GET arrays using foreach() - the
>> order key=>value pairs will popup will be the order they are positioned on the
>> original web-page.
>> 
>> Monday, February 03, 2003, 11:12:41 PM, you wrote:
>> 
>> SM> Does anyone know how to detect the position of submitted form elements on
>> a
>> SM> webpage? I know that submit buttons or images will send x,y coordinates,
>> but
>> SM> what about text boxes, checkboxes, etc? I am trying to extract this info
>> SM> from submitted forms. Any thoughts would be helpful and appreciated.
>> 
>> SM> steve miller 

-- 
Best regards,
 German                            mailto:[EMAIL PROTECTED]
 ICQ:48533867



____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: archive@jab.org
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to