NS 4.7 and field html into usercontrol

NS 4.7 and field html into usercontrol

Post by Max » Thu, 01 Sep 2005 00:03:05


i need to access an textbox defined into my usercontrol.
the render of the textbox is myASCX:myTextbox.

How can i access this field in js client envirnoment with NETSCAPE 4.7 ?
Thanks
 
 
 

NS 4.7 and field html into usercontrol

Post by Clint Hil » Thu, 01 Sep 2005 00:21:16

Maybe this:
<script language="JavaScript">
<!--
function GetObject(obj)
{
if (document.getElementById) {
obj = document.getElementById(obj);
} else if (document.all) {
obj = document.all.item(obj);
} else {
obj = null;

}
return obj;
}//-->
</script>

Clint Hill
H3O Software
http://www.yqcomputer.com/

 
 
 

NS 4.7 and field html into usercontrol

Post by Max » Thu, 01 Sep 2005 02:01:23

Sorry but your code is not execute corretly with ns 4.7 (6.0 yes).
I have an textbox control that's name is myascx:mytextbox.

The js function not run.

Thanks


"Clint Hill" < XXXX@XXXXX.COM > ha scritto nel messaggio
 
 
 

NS 4.7 and field html into usercontrol

Post by Bruce Bark » Thu, 01 Sep 2005 03:07:25

in netscape 4, to access a textbox, you need to know the name (not the id)
attribute. then use the dom 1.0 model.

document.forms[0].elements['textboxname'];

note: this syntax is supported by all browsers.

-- bruce (sqlwork.com)
 
 
 

NS 4.7 and field html into usercontrol

Post by Max » Thu, 01 Sep 2005 15:46:50

sorry it's not correct.

i have an dropdown into my user control.
the render is :
<SELECT name="BolloAutoEdit1:cboAnno" id="BolloAutoEdit1_cboAnno">
</SELECT>

document.forms[0].elements['BolloAutoEdit1:cboAnno'].value NOT CORRECT, is
NULL

thanks


"Bruce Barker" < XXXX@XXXXX.COM > ha scritto nel messaggio
 
 
 

NS 4.7 and field html into usercontrol

Post by Martin Hon » Thu, 01 Sep 2005 22:11:49


But that is correct, in Netscape 4's object model the value of a
<select> element object is always null.
You need to read out the value of a or the selected option e.g.
var form, select, value;
if ((form = document.forms[0]) && (select =
form.elements['BolloAutoEdit1:cboAnno'])) {
if (select.selectedIndex > 0) {
value = select.options[select.selectedIndex].value;
}
}


--

Martin Honnen --- MVP XML
http://www.yqcomputer.com/
 
 
 

NS 4.7 and field html into usercontrol

Post by Max » Fri, 02 Sep 2005 16:47:49

grazie 1000 !!!

"Martin Honnen" < XXXX@XXXXX.COM > ha scritto nel messaggio