Re: Loop problem
| From: | Richard Lynch | Date: | Fri, 04 May 2007 19:38:19 +0000 |
| Subject: | Re: Loop problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254431@lists.php.net to get a copy of this message | ||
On Fri, May 4, 2007 1:02 pm, Dan Shirah wrote:
> type = document.Submit.request_type.value
If you have only one "request_type" button, JavaScript can sorta
figure out which one you want here, cuz there's only one.
As soon as you have a whole bunch of them, it's got no idea which one
you want...
The easiest fix I can see would be to give each submit button a unique
name (or id, or both) so that you are looking for something more like:
var name = 'request_type_' + id;
var type = document.Submit[name].value;
or somesuch.
I dunno JS well enough to know that I've done the right thing, but go
that direction.
Maybe even go whole who and use that nifty getElementById function.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?