[thelist] changing submit button value with javascript

Dan Parry dan at virtuawebtech.co.uk
Tue Jul 31 17:46:13 CDT 2007


> -----Original Message-----
> From: thelist-bounces at lists.evolt.org [mailto:thelist-
> bounces at lists.evolt.org] On Behalf Of Joel D Canfield
> Sent: 31 July 2007 20:10
> To: thelist at lists.evolt.org
> Subject: [thelist] changing submit button value with javascript
> 
> I'm trying to change the value of a submit button with javascript. when
> the 'delete this item' checkbox is clicked, I want to toggle the value
> of the submit button to 'Del', and when it's clicked again, toggle it
> back to 'Save'
> 
> all that happens is the submit button is selected, but not changed
> 
> here's how I'm calling the function
> 
>     <input type="checkbox" name="delasset" id="delasset0"
> onclick="toggleValue('submit0','delasset0','Save','Del');" />

Try changing the function call to:

toggleValue('submit0',this,'Save','Del');

When you check clickedID in the function it finds the string 'delasset0'
which it then evaluates the method 'checked', which never exists so will
always be false

I just gave a fairly quick scan so sorry if I'm wrong :)

Dan




More information about the thelist mailing list