help! i have problems with document.getElementById("form1:textField1")

hello

sorry my english

my problem that is creator not display in the window alert , the box text content's

component button have a event onclick ,where it call the function saludar(" form1:textField")

here is my code

<script><![CDATA[

function saludar(texto) {

mitexto=document.getElementById(texto);

alert(mitexto.value);

}]]></script>

<ui:form binding="#{cesar1.form1}" id="form1">

<ui:textField binding="#{cesar1.textField1}" id="textField1" l

><ui:button action="ir" binding="#{cesar1.button1}" id="button1"onClick="saludar(&quot;form1:textField1&quot;)"

thanks you>

[685 byte] By [scraftera] at [2007-11-27 11:18:58]
# 1

Hi, here's one way to do it:

1.- Place the following script in the jsp code

<script>

function test(form){

var text1= form["form1:textField1"].value;

alert("Value: "+ text1);

}

</script>

2.- In the onclick method of the button place:

return test(this.form);

hope it helps you!

Yes...

Yeseniaa at 2007-7-29 14:34:04 > top of Java-index,Development Tools,Java Tools...