> I am trying to do a test application using struts, DWR > I am having problem with document.getElementById > method in javascript, this works fine in IE 6.0 and > opera > I am using struts tag > <html:text title="last" property="last" size="60" readonly="true" /> > > and then in my javascript doing the following > document.getElementById('last').value= data; > > Firefox gives me javascript error, element with name > last not found, > but if i define this field as > <INPUT type="text" name="last" id="last" size="60" > maxlength="50" value="" readonly="readonly"> > > It works in firefox, so how can i define struts tag to > get the id attribute , or is there a work around
You've hit the nail on the head, you need to tell the <html:text> tag to output an "id" attribute. You do that by using the styleId attribute of the tag: <html:text title="last" property="last" size="60" readonly="true" styleId="last"/> -- Tim Slattery [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]