Sounds like you're running into a variance between the IE and Firefox object models. For best performance, I would recommend restricting your javascript to the DOM standard.
You can find the object model for MSIE here: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp You can find the object model for Firefox here: http://developer.mozilla.org/en/docs/Gecko_DOM_Reference You can find the JavaScript bindings for the DOM Level 2 Core can be found here: http://www.w3.org/TR/DOM-Level-2-Core/ecma-script-binding.html Assuming state is the id of the element and idx is text content to be set for that element, the following should work (untested) for both MSIE and Firefox: var stateElem = document.getElementById(state); var oldContent = stateElem.getFirstChild(); var newContent document.createText(idx); stateElem.replaceChild(newContent, oldContent); HTH, Ian It's better to be hated for who you are than loved for who you are not Ian D. Stewart Appl Dev Analyst-Advisory, DCS Automation JPMorganChase Global Technology Infrastructure Phone: (614) 244-2564 Pager: (888) 260-0078 Alessandro Vincelli To: [email protected] <[EMAIL PROTECTED] cc: t> Subject: Re: Multiple forms per page 12/13/2005 10:24 AM Please respond to users I have a problem in cocoon 2.1.8 with a tab form... in Explorer no problem in Firefox this error: Error: document.getElementById(state) has no properties Source File: ... /js/forms-lib.js Line: 180 in forms-libs.js function forms_showTab(tabgroup, idx, length, state) { // Change state value if (state.length > 0) { document.getElementById(state).value = idx; } .... Can you help me? thanks in advance, Alessandro ------------------------------- Alessandro Vincelli W4B - web for business s.r.l. Firenze via Pellicceria 10 - 50123 E-mail: [EMAIL PROTECTED] tel: 055-2654270 Sylvain Wallez ha scritto: > werner wrote: > >> Yes, it's true. The tabs don't work when you have another form on the >> page. This problem can be solved if you change the line in forms-lib.js: >> >> document.forms[0][state].value = idx; >> >> to >> >> document.getElementById(state).value=idx; >> >> Then there is another change in the xsl necessary, because the tab-state >> widget is not generated with an id attribute (only with a name). In >> forms-page-styling.xsl look for the line >> >> <input type="hidden" name="{$state-widget}" value="{$active}"/> >> >> and add the id attribute >> >> <input type="hidden" name="{$state-widget}" id="{$state-widget}" >> value="{$active}"/> >> >> Then it works. I don't know it this is a hack or not. As far as I have >> seen, this problem exists in 2.1.7 and 2.1.8 (without >> Ajax) >> > > > It will be in 2.1.8 :-) > > Thanks for spotting this! > > Sylvain > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
