Emulating a <select> form in Flash.
Hi.
One of my clients has a <select> form that lists a bunch of counties that looks a bit like this:
This is submitted to a script which we have no control over. We would like to replace this with a map that users could click on and select counties.
It seems like the getURL() function would be the function we would want to use to submit the data, since we want the HTML that is normally printed from the script to be displayed. There are some problems, though. I didn't notice anyway to explicitly set the URL encoded string to send. This is a problem because the script is expecting something that looks like:
However, when getURL swipes whatever variables are in it's scope, arrays end up looking like:
Setting a scalar variable to something like
Short of having flash getURL a script that splits up the list variable, connects to the real CGI script, and prints those results, I am out of ideas. Is there a more suitable function for what I want to do? Or am I misunderstanding something about getURL?
One of my clients has a <select> form that lists a bunch of counties that looks a bit like this:
<select multiple="multiple" name="list" size="7">
<option value="10630">Abington-10630</option>
<option value="10202">Adamstown-10202</option>
...
</select>This is submitted to a script which we have no control over. We would like to replace this with a map that users could click on and select counties.
It seems like the getURL() function would be the function we would want to use to submit the data, since we want the HTML that is normally printed from the script to be displayed. There are some problems, though. I didn't notice anyway to explicitly set the URL encoded string to send. This is a problem because the script is expecting something that looks like:
list=val1&list=val2&list=val3
However, when getURL swipes whatever variables are in it's scope, arrays end up looking like:
list=var1,var2,var3,var4
Setting a scalar variable to something like
list=var1&list=var2...doesn't work (which is a good thing in most cases!) because getURL automatically escapes all non-alphanumeric characters. Appending a query string after the URL isn't a good option (if that works?), since it should be a POST submission. A successful submission sends an email to my client (and possibly makes changes to a db of some sort?), so it would be lame if someone bookmarked that page. :)
Short of having flash getURL a script that splits up the list variable, connects to the real CGI script, and prints those results, I am out of ideas. Is there a more suitable function for what I want to do? Or am I misunderstanding something about getURL?
