Re: Argh!!!! Help with something o-f-f-t-o-p-i-c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You need to get the element by name and then do the confirmation...



On Thu, 2002-11-07 at 21:23, Aaron Wolski wrote:
> Sorry for the OT post y'all.. but I can't find this answer - well not
> without major major code information that I can't figure out!
>  
> Basic?
>  
> I have a series of checkbox arrays like:
>  
> <input type="checkbox" name="delete[]" value="$row[id]">
>  
> These are for different records in my DB.
>  
>  
> Now... I want to check (javascript - this is the off topic part :P) if
> one of them checkboxes HAS been selected and if so display a confirm
> message.
>  
> This is what I have:
>  
> function checkform(f) {
>  
>   var el, e = 0, firstBox, msg = 'You are about to delete something';
>  
>   while (el = f.elements[e++]) 
>  
>    if (el.type == 'checkbox' && el.checked) {
>     return confirm(msg); 
>     return false;
>    }
>  
>   return true;
>  
>  }
>  
> Now... this DOES work but with one problem.. I have another checkbox
> within the form that does something different but the confirm() will
> display if EITHER checkboxes are selected and it SHOULD ONLY be on the
> delete[] checkbox.
>  
> I know.. waaay off topic but I don't know how to reference the names
> that are arrays in javascript :(
>  
> Sorry again all.
>  
> Aaron
-- 
.: B i g D o g :.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux