javascript - <html: image directly calling struts action class -


i want call submitformfinal(this.form); client side validation.but problem html:image property directly calls struts, server side validation takes place before calling submitformfinal(this.form). if submitformfinal fails , server side validations should not take place ,but in case html:image directly calls struts action classs.... suggestions?

right code is:-<html:image
src='<%=contextpath + "/img/save_orange.gif"%>' onclick="javascript:submitformfinal(this.form); "/>

what returning value submitformfinal():

<html:image src='<%=contextpath + "/img/save_orange.gif"%>'             onclick="return submitformfinal(this.form);"/> 

now if submitformfinal() returns false wont submit, if returns true submitted.

update :

after seeing next problem, here thoughts.

1) should not use <html:image> submitting form. <html:submit> correct submit button tag. recommend change <html:image> <html:submit>. u can add image button styleid, styleclass attributes. no need call onclick on button. submit form when click it.

2) add onsubmit on <html:form> tag this:

<html:form action="someaction.do" onsubmit="return submitformfinal();"> 

this work desired guess.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -