G
Guest
hey all,
is there a way to get the name of my form element in javascript?
thanks,
rodchar
is there a way to get the name of my form element in javascript?
thanks,
rodchar
Ken Cox said:Hi Rod,
Here's some code that might get you started.
Let us know if this helps?
Ken
Microsoft MVP [ASP.NET]
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
Label1.Text = Me.Form.ClientID
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Get the form name</title>
<script language="javascript" type="text/javascript">
function GetFormName()
{
var frm = document.forms[0].name;
alert(frm);
}
</script>
</head>
<body onload="GetFormName();">
<form id="form1" runat="server">
<div>
<asp:label id="Label1" runat="server" text="Label"></asp:label>
</div>
</form>
</body>
</html>
rodchar said:hey all,
is there a way to get the name of my form element in javascript?
thanks,
rodchar