Hi, I guess this function is used by JSF to clear all form's elements for submit. I've never used this function before.
Regards. -----Original Message----- From: Le Van [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 29, 2006 8:57 AM To: MyFaces Discussion Subject: Re: Java Script error with My Faces Thank Yura, but clear_form use for what ?. You think it generates by JSF, but it just generate when I use t:commandButton instead of using h:commandButton. And is it important to using it. Could I control it ???. Cause I can't control it now so I create a clear_form() function that do nothing. Coudl you tell me more clearly about clear_form(). Yura.Tkachenko wrote: > Hi, Le Van > > Actually why are you using clear_form() function? Is it just training? > Actually this function generates by JSF it can include something like > that: > > function clear_form() { > > var f = document.forms['form']; > > f.elements['prevSort'].value=''; > > f.elements['prev'].value=''; > > f.elements['prevItemId'].value=''; > > f.elements['prevAsc'].value=''; > > f.elements['prevItemName'].value=''; > > f.elements['ret'].value=''; > > f.elements['roleid'].value=''; > > f.elements['form:_link_hidden_'].value=''; > > f.elements['itemid'].value=''; > > f.target=''; > > } > > If you need button which will reset form's values you can use this > script: > > <t:input type="button" value="Reset" onclick="this.form.reset();" /> > > -----Original Message----- > From: Le Van [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 29, 2006 7:50 AM > To: users@myfaces.apache.org > Subject: Java Script error with My Faces > > Dear all, > > Now , I face with the problem is: Browser render the component: > > <t:commandButton id = "test" value="submit" /> and we view source code > > (After rendered) We recorgnized that IE also render the t:commandButton > > like :<t:input type="submit" value="submit" onclick="clear_form()" />. > > But We do not see the function clear_form() anywhere, so when we click > > the that button, Browser will raise an javascript error. > > Anyone got that problem could help me. > > Thanks. >