vigiw Posted January 16, 2007 Share Posted January 16, 2007 ???I am trying to get multiple outputs to display in a text field. It is an image map, which if I click one hotspot, it will display in the proper form field, however, if I click another, the newest hotspot selection will replace the previous one.They are found with a file.php?blah=selected type situation, here is in the image map code at the top of the PHP form page:[code]<MAP NAME=mymap><area href="submit.php?hampden=selected<?php if($_GET['hampden']) echo "&hampden=" . $_GET['hampden'] ?>" ALT="Hampden County" shape="polygon" coords="125, 199, 168, 201, 167, 205, 176, 209, 181, 200, 216, 203, 287, 202, 295, 201, 295, 174, 286, 171, 280, 167, 274, 165, 274, 156, 264, 153, 257, 158, 255, 162, 249, 161, 246, 155, 211, 156, 207, 153, 209, 142, 206, 143, 202, 148, 197, 155, 192, 163, 179, 160, 174, 153, 165, 155, 158, 149, 155, 149, 156, 131, 153, 124, 139, 131, 136, 136, 131, 168, 123, 174"><area href="submit.php?berkshire=selected<?php if($_GET['berkshire']) echo "&berkshire=" . $_GET['berkshire'] ?>" ALT="Berkshire County" coords="42, 196, 125, 200, 123, 175, 131, 170, 136, 135, 131, 132, 126, 128, 126, 115, 136, 118, 138, 94, 148, 28, 90, 25, 85, 30, 54, 131, 51, 145, 44, 175" shape=polygon><area href="submit.php?hampshire=selected<?php if($_GET['hampden']) echo "&hampshire=" . $_GET['hampshire'] ?>" shape="polygon" coords="140, 75, 158, 78, 162, 91, 183, 98, 186, 98, 190, 98, 191, 107, 200, 109, 224, 105, 234, 108, 249, 108, 269, 123, 271, 135, 278, 135, 280, 146, 277, 154, 274, 155, 264, 153, 253, 161, 249, 161, 245, 156, 205, 155, 208, 143, 192, 161, 178, 162, 172, 152, 166, 153, 156, 145, 155, 127, 152, 125, 136, 134, 126, 126, 127, 116, 132, 118, 133, 118, 138, 102"><area href="submit.php?franklin=selected<?php if($_GET['franklin']) echo "&franklin=" . $_GET['franklin'] ?>" shape="polygon" coords="257, 114, 268, 92, 274, 80, 271, 71, 272, 61, 279, 51, 270, 43, 268, 33, 266, 30, 148, 30, 141, 76, 156, 77, 167, 93, 188, 99, 189, 100, 192, 108, 226, 105, 249, 109"><area href="submit.php?worcester=selected<?php if($_GET['worcester']) echo "&worcester=" . $_GET['worcester'] ?>" shape="polygon" coords="294, 202, 364, 207, 414, 205, 413, 171, 396, 159, 392, 154, 400, 146, 409, 142, 413, 133, 409, 129, 397, 127, 395, 129, 392, 122, 404, 104, 405, 80, 397, 74, 380, 82, 381, 74, 381, 67, 373, 55, 362, 50, 343, 54, 348, 40, 342, 37, 266, 30, 272, 42, 278, 52, 271, 66, 272, 80, 266, 95, 259, 114, 269, 121, 271, 136, 276, 136, 280, 137, 278, 152, 272, 160, 283, 173, 294, 174, 295, 184"><area href="submit.php?litchfield=selected<?php if($_GET['litchfield']) echo "&litchfield=" . $_GET['litchfield'] ?>" shape="polygon" coords="42, 197, 39, 295, 57, 332, 105, 331, 124, 311, 139, 302, 142, 289, 132, 276, 132, 265, 134, 259, 151, 259, 145, 255, 145, 250, 145, 240, 148, 236, 156, 218, 133, 218, 136, 200"><area href="submit.php?hartford=selected<?php if($_GET['hartford']) echo "&hartford=" . $_GET['hartford'] ?>" shape="polygon" coords="141, 297, 149, 317, 169, 318, 199, 307, 223, 304, 239, 307, 243, 304, 236, 291, 229, 252, 228, 247, 223, 240, 226, 203, 182, 201, 175, 209, 167, 205, 165, 200, 136, 200, 134, 215, 155, 219, 145, 243, 147, 255, 149, 258, 133, 261, 132, 276, 139, 288"><area href="submit.php?tolland=selected<?php if($_GET['tolland']) echo "&tolland=" . $_GET['tolland'] ?>" shape="polygon" coords="227, 205, 227, 222, 225, 235, 226, 243, 241, 308, 254, 306, 260, 298, 275, 280, 279, 275, 288, 264, 286, 255, 282, 249, 281, 221, 297, 221, 305, 204, 283, 201"><area href="submit.php?windham=selected<?php if($_GET['windham']) echo "&windham=" . $_GET['windham'] ?>" shape="polygon" coords="273, 281, 304, 303, 357, 295, 355, 207, 306, 204, 297, 222, 282, 219, 282, 249, 287, 262"></MAP><IMG SRC="http://www.vigilantweather.com/forecast/maps/sfd.jpg" ALT="Site map" USEMAP="#mymap" WIDTH=445 HEIGHT=457>[/code]Here is the form field's code:[code]<textarea name="field4" rows="9" cols="78"><?phpif($_GET['hampden'] == "selected") echo "Hampden, ";if($_GET['berkshire'] == "selected") echo "Berkshire, ";if($_GET['hampshire'] == "selected") echo "Hampshire, ";if($_GET['franklin'] == "selected") echo "Franklin, ";if($_GET['worcester'] == "selected") echo "Worcester, ";if($_GET['litchfield'] == "selected") echo "Litchfield, ";if($_GET['hartford'] == "selected") echo "Hartford, ";if($_GET['tolland'] == "selected") echo "Tolland, ";if($_GET['windham'] == "selected") echo "Windham, ";?></textarea>[/code]Note that is just the image map part and not the full page code. Is there a way to make it so I can have multiple counties shown in the form field if multiple are selected at one time. Like if Berkshire and Hampshire were both to be selected, or whatever necessary.I am very puzzled and can't figure this out! >:(Any help appreciated--thanks! Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted January 16, 2007 Share Posted January 16, 2007 You dont need muliple ? marks in the url.. Just &&..Ie www.mydomain.com/file.php?hamdem=selected&&tolland=selected-Andy Quote Link to comment Share on other sites More sharing options...
vigiw Posted January 16, 2007 Author Share Posted January 16, 2007 Thanks Andy, But where do I place the && --- any combination of counties could be selected at one time.Thanks. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 16, 2007 Share Posted January 16, 2007 First of all, You just use one & Secondly, you can have as many sets in a url as you want..php?one=1&two=2&three=3&bob=fred Quote Link to comment Share on other sites More sharing options...
vigiw Posted January 16, 2007 Author Share Posted January 16, 2007 Ok thanks, but where do I place the & symbol in the code I had in the first post here? Because there will be multiple selections in one form submission, in any combination. Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 16, 2007 Share Posted January 16, 2007 I don't see how you can have multiple selections with your current setup. You are using an image map, so the user can only select one "location". The only solution I can think of using an image map would be to use javascript to build the url as they click multiple locations. But, then you would also need to include functionality for the user to remove locations.Perhaps, you need to find another site that has functionality that is similar to what you want and then build your solution around that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.