struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Mitchell <jmitch...@apache.org>
Subject RE: how to disable submit button when click on checkbox
Date Tue, 18 Nov 2003 04:19:15 GMT
On Mon, 17 Nov 2003, David Friedman wrote:

> Philip,
>
> If it is in the same "<form...> ... </form>" form tag, try this javascript:
> this.form.delete.disabled=true

That disabled the button, but doesn't stop anyone from submitting the form
(like....pressing enter in a text box).

You could add something like this to your form onsubmit attribute (change
as desired)


<form name="frm" action="/do/something.do"
	onsubmit="JavaScript:return
!this.elements['some.field.checkbox'].checked;"
	method="GET">


<input type="input" name="text2" value="something"><br><br>

<input type="checkbox" name="some.field.checkbox"> Do not click this<br>
<input type="submit" name="sbmt" value="Submit">

</form>


>
> -David
>
> -----Original Message-----
> From: Philip [mailto:yuensunlam@yahoo.com]
> Sent: Monday, November 17, 2003 11:02 PM
> To: struts-user@jakarta.apache.org
> Subject: how to disable submit button when click on checkbox
>
>
> I have a question regarding checkbox, how can I disable a certain submit
> button when click on a checkbox?
> I tried the following but is not working:
> <html:submit property="delete" value="Delete"/>
> <html:checkbox property="ids" value="id"
> onclick="document.formName.delete.disabled=true" />
>
> Also, is there a way I can count how many checkbox are selected in my jsp
> code?
>
> Please kindly help me.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

-- 
James Mitchell
Software Developer / Struts Evangelist
http://www.struts-atlanta.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message