Click here to Skip to main content
16,017,899 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to I create a "New articles of today" list in the website? Pin
eyeseetee29-Jul-08 22:50
eyeseetee29-Jul-08 22:50 
Questionhow to pass the ID of a text box in a gridview to a javascript Pin
Arindam Datta29-Jul-08 21:29
Arindam Datta29-Jul-08 21:29 
AnswerRe: how to pass the ID of a text box in a gridview to a javascript Pin
Imran Khan Pathan29-Jul-08 21:45
Imran Khan Pathan29-Jul-08 21:45 
AnswerRe: how to pass the ID of a text box in a gridview to a javascript Pin
eyeseetee29-Jul-08 21:51
eyeseetee29-Jul-08 21:51 
GeneralRe: how to pass the ID of a text box in a gridview to a javascript Pin
J4amieC29-Jul-08 22:05
J4amieC29-Jul-08 22:05 
GeneralRe: how to pass the ID of a text box in a gridview to a javascript Pin
eyeseetee29-Jul-08 22:20
eyeseetee29-Jul-08 22:20 
GeneralRe: how to pass the ID of a text box in a gridview to a javascript Pin
Arindam Datta29-Jul-08 22:07
Arindam Datta29-Jul-08 22:07 
GeneralRe: how to pass the ID of a text box in a gridview to a javascript Pin
J4amieC30-Jul-08 0:03
J4amieC30-Jul-08 0:03 
<asp:textbox id="txttrgtprd" runat="server" font-size="X-Small" onfocus="getdata(this)" ontextchanged="txttrgtprd_TextChanged" backcolor="#ffffcc" width="70px" text="<%# Eval("TRGT_PRD") %>" autopostback="true" xmlns:asp="#unknown"></asp:textbox>

function getdata(obj)
{
   var txt = document.getElementById(obj);
   txt.value='0';
}


note in the above snippet that you are passing a reference to the textbox (this) to the javascript method, hence you dont need the getElementById at all - you already have a reference to the element.

therefore, your javascript method can simply be
function getdata(obj)
{
   obj.value='0';
}


or your textbox's onfocus could simply be:

onfocus="this.value='0';"
AnswerRe: how to pass the ID of a text box in a gridview to a javascript Pin
J4amieC29-Jul-08 22:06
J4amieC29-Jul-08 22:06 
GeneralRe: how to pass the ID of a text box in a gridview to a javascript Pin
Arindam Datta29-Jul-08 22:11
Arindam Datta29-Jul-08 22:11 
QuestionPaypal integration Pin
Prashant B. Lavate29-Jul-08 21:24
Prashant B. Lavate29-Jul-08 21:24 
AnswerRe: Paypal integration Pin
eyeseetee29-Jul-08 21:53
eyeseetee29-Jul-08 21:53 
Questionhow to pass a textbox ID which is in a grid view to a java script Pin
Arindam Datta29-Jul-08 21:21
Arindam Datta29-Jul-08 21:21 
AnswerRe: how to pass a textbox ID which is in a grid view to a java script Pin
Anudeep Jaiswal1-Aug-08 0:36
Anudeep Jaiswal1-Aug-08 0:36 
QuestionASP.NET 1.1 User Control Can't Set Focus [modified] Pin
peter_790129-Jul-08 20:52
peter_790129-Jul-08 20:52 
AnswerRe: ASP.NET 1.1 User Control Can't Set Focus Pin
peter_790129-Jul-08 21:52
peter_790129-Jul-08 21:52 
Questionajax dual slider problem asp.net c# Pin
VijayVishwakarma29-Jul-08 20:47
VijayVishwakarma29-Jul-08 20:47 
Question"External table is not in the expected format." how to solve this error? Pin
sathyan_829429-Jul-08 19:37
sathyan_829429-Jul-08 19:37 
AnswerRe: "External table is not in the expected format." how to solve this error? Pin
Imran Khan Pathan29-Jul-08 19:45
Imran Khan Pathan29-Jul-08 19:45 
GeneralRe: "External table is not in the expected format." how to solve this error? Pin
Imran Khan Pathan29-Jul-08 20:13
Imran Khan Pathan29-Jul-08 20:13 
GeneralRe: "External table is not in the expected format." how to solve this error? Pin
Christian Graus29-Jul-08 20:20
protectorChristian Graus29-Jul-08 20:20 
GeneralRe: "External table is not in the expected format." how to solve this error? Pin
Imran Khan Pathan29-Jul-08 20:33
Imran Khan Pathan29-Jul-08 20:33 
AnswerRe: "External table is not in the expected format." how to solve this error? Pin
Christian Graus29-Jul-08 20:06
protectorChristian Graus29-Jul-08 20:06 
AnswerRe: "External table is not in the expected format." how to solve this error? Pin
satyaanand.andra@gmail.com29-Jul-08 21:26
satyaanand.andra@gmail.com29-Jul-08 21:26 
GeneralRe: "External table is not in the expected format." how to solve this error? Pin
J4amieC29-Jul-08 22:11
J4amieC29-Jul-08 22:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.