NS 4.7 and field html into usercontrol

M

Max

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
 
C

Clint Hill

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.h3osoftware.com
 
M

Max

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
 
B

Bruce Barker

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)
 
M

Max

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 said:
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)



Max said:
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
 
M

Martin Honnen

Max wrote:

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

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;
}
}
 
M

Max

grazie 1000 !!!

Martin Honnen said:
Max wrote:

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

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;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top