Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing Map Points from Client to Server Values

    I can get the javascript to gather an array of map points and pass them to a <Select, however after I submit and run a simple PHP echo script on $points to show the data, nothing comes up.

    What am I missing. I must be doing something simple and stupidly wrong here. How is it suppose to be done. I'm missing a key concept in how variables are passed from client to server.

    Here's what I am doing as of Aug. 20 at 6:30pm PST.

    http://www.jameslove.com/gpolygon.php

    <form name="form1" method="post" action="">
    <select id="pointList" name="points" multiple size="14" onChange="highlight(this.selectedIndex)"
    onDblClick="jumpToPoint()" name="select">
    </select>
    <br/>
    <input type="button" value="Delete All Points" onClick="deleteAllPoints()" name="button"/>
    </p>

    <div align="center">
    <input type="submit" name="done" value="Done">

  • #2
    Regular Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    223
    Thanks
    0
    Thanked 14 Times in 14 Posts
    You are adding the points to the select list correctly but you will need to select the entry/entries you want to submit. Remember that only the selected item(s) in a select list get submited.

    You need a bit of javascript to select all the items in the select list prior to submitting the form, something like this:
    Code:
    function form_submit() {
     var i, oform = document.forms['form1'];
     for (i=0; i< oform.elements['points'].length; i++) {
      oform.elements['points'].options[i].selected = true;
     }
     oform.submit();
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •