|
-
May 22nd, 2001, 12:59 AM
#1
Thread Starter
Lively Member
IsObject in Javascript
Hello Everybody,
i want to get the souce code for isobject function
in javascript.
I want to validate the form conditionally ,if a textbox named
txtname is present then validate its value else don't do,
But here what's happening means ,if the textbox is present
my function validating else its telling object not found ,
So how can i detect the occurance the object in a html page at the
client side itself.
Aniz
I respect love and lovers ,but it should be possesive .
I love friendship and friends but it should be true.
-
May 22nd, 2001, 06:22 AM
#2
Lively Member
You can easily check if there's a specific item in the form by using an standard "if":
Code:
<script language="javascript">
function checkTxtBox()
{
if (document.frm.txtname)
{alert("There is a box!");}
else
{alert("There isn't a box!");}
}
</script>
<form name="frm">
<input type="text" name="txtname" value="test">
<input type="button" onClick="checkTxtBox()">
</form>
/fredrik
________________________
Fredrik Klarqvist
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|