on 07-18-2006 6:13 AM
Hi All,
Im trying to use client data bag..,for achieving this I want to get the id of elements say,inputfield in javascript..how should i get the id..any idea...if anyone tried out client data bag in .net give me an idea for achieving this..
Regards,
Vinoth
Message was edited by: Vinoth M
Hi Ofer,
This is my code..
<body class="prtlBody" xmlns:sap="urn:http://schemas.sap.com/SAP.Web.UI.Controls">
<script language="JavaScript">
var data = "";
function go(){
var funcName = <%=Form.id "."InputFieldChild.ClientID %>;
alert(funcName)
}
</script>
<form id="form1">
<table>
<tr width="100%">
<td width="100%"><sap:textview id="TextViewChild" Visibility="VISIBLE" Text="Enter Value:" Design="HEADER1" Runat="server"></sap:textview>
<sap:inputfield id="InputFieldChild" Visibility="VISIBLE" Runat="server" Value=""></sap:inputfield>
</td>
</tr>
<tr width="100%">
<td width="100%">
<sap:Button ID="ButtonChild" Runat="server" Text="StoreData" Design="EMPHASIZED" Visibility="VISIBLE"
BUTTONCLICK="javascript:go();"></sap:Button></td>
</tr>
</table>
</form>
</body>
im getting the output in alert for funName as [object].
Am i missing something..??could u tel me where am i make the necessary change..
Regards,
Vinoth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ofer,
No, i didnt tried control.clientid yet ..could u tel me the syntax for tht..
regards,
Vinoth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, it depends on what you are trying to do, but this is server coed, meaning it's C# code... you can look it up in the help, but essentially it's a property of all controls called "ClientID". In ASP controls (and SAP controls) it will hold the ID that will be rendered to html. I'm guessing you have some JS which is doing something. So it should look like something like this:
<SCRIPT language ="JavaScript">
function doSearch(id, e)
{
var myControlID=<%= Form.ID+"."+myControl.ClientID %>;
...
}
</SCRIPT>
Regards,
Ofer
Hi Vinoth,
Did you try writing to your Script the property Contorl.ClientID?
Regards,
Ofer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.