Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem with java script

843838Feb 13 2006 — edited Feb 13 2006
hii,

i have taken textboxes in for loop.i want to do that if the values in the textboxes are 0,and if the user clicks the textbox then that textbox value
should disappear.if the value is not 0 then it should not disappear.

i got it,but i also want that if the user clicks on another textbox and the above one does not given any value then it should take automatically as 0.i am not getting it.

if any body knows,tell me.
i am sending the code.

i have taken for loop in jsp like

<%
for(int i=0;i<10;i++)
{
%>

<input type="text" name="box" value='0' size="6" onClick="fnTest('<%=i%>')"><br>
<%
}
%>


the function is

function fnTest(str)
{
//alert("Str value"+str);
if(formHeader.box[str].value=='0')
{
formHeader.box[str].value=' ';
}
}



thanx
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2006
Added on Feb 13 2006
5 comments
104 views