On 5 Sep, 23:13, Gregor Kofler <use...@gregorkofler.atwrote:
Quote:
GarryJones meinte:
>
Quote:
The following works in MSIE but not firefox.
DIVs don't have names. Forms and their elements have.
Still no go I am afraid....
Let me explain. The DIV has an ID and the first 2 rows of code either
display or hide the DIV which is correctly called by its id. Now, in
that DIV is a form. And on that form there are some elements which
have names. When the user clicks the link which fires this code it is
supposed to empty any previously entered value.
What I want is for the form to start with focus in the tavfnmkas
field. This field should be empty so any left over data from previous
viewings should be cleaned out when the button is clicked and the DIV
(with the form) toggles status "none" to status "block" and becomes
visible.
What these three "document.getElementsByName" lines should do is
document.getElementsByName("grant_ask").selectedIn dex=0; //SHOULD set
the selected option index to zero in a SELECT
document.getElementsByName("tavfnmkas").value=""; //SHOULD removed any
previously entered data from the field tavfnmkas
document.getElementsByName("tavfnmkas").focus() //SHOULD place focus
in the field tavfnmkas
"None of the above" is the result of my competence and understanding
of this. I am very gratefull of any further help anyone would like to
provide.
My latest attempt using getElementsByName
***********************************************
function InsertContentshowgruppanm(tid) {
if( document.getElementById(tid).style.display == "none") {
document.getElementById(tid).style.display = "block";
document.getElementsByName("grant_ask").selectedIn dex=0;
document.getElementsByName("tavfnmkas").value="";
document.getElementsByName("tavfnmkas").focus()
}
else {
document.getElementById(tid).style.display = "none";
}
}
Any help appreciated!
Garry Jones
Sweden