Click here to Skip to main content
15,911,132 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: dropdownlist in java script Pin
Arif patel27-Oct-07 1:49
Arif patel27-Oct-07 1:49 
Questiontextbox substring validation Pin
Sonia Gupta26-Oct-07 22:45
Sonia Gupta26-Oct-07 22:45 
AnswerRe: textbox substring validation Pin
John-ph26-Oct-07 23:11
John-ph26-Oct-07 23:11 
AnswerRe: textbox substring validation Pin
Abhijit Jana26-Oct-07 23:15
professionalAbhijit Jana26-Oct-07 23:15 
AnswerRe: textbox substring validation Pin
Imran Khan Pathan26-Oct-07 23:21
Imran Khan Pathan26-Oct-07 23:21 
AnswerRe: gridview Pin
N a v a n e e t h26-Oct-07 22:40
N a v a n e e t h26-Oct-07 22:40 
Questionclient side validations Pin
Sonia Gupta26-Oct-07 21:40
Sonia Gupta26-Oct-07 21:40 
AnswerRe: client side validations Pin
N a v a n e e t h26-Oct-07 21:54
N a v a n e e t h26-Oct-07 21:54 
Sonia Gupta wrote:
i wanted to do the validations at the client end.i mean first i want to validate the textbox in the javascript , if it is having some value , only then the code behind code should execute.How should i do it


Assume your button is button1. So in page load event, write something like
button1.Attributes.Add("OnClick","return MyJSFunc();");

This will add the Onclick attribute to the button. Now inside the MyJSFunc(), get textbox element and check the value. If value is ok, return true else return false.
function MyJSFunc()
{
   var TxtBox = document.getElementById("YourTextboxId");
   if(TxtBox.value == "")
   { 
      alert("Enter value");
      return false;
   }
   else
      return true;
}


These are the basic things, and I recommend you to buy a book and learn how things are working.


Questionhow????????????? Pin
ajsgja26-Oct-07 19:58
ajsgja26-Oct-07 19:58 
AnswerRe: how????????????? Pin
Imran Khan Pathan26-Oct-07 20:07
Imran Khan Pathan26-Oct-07 20:07 
GeneralRe: how????????????? Pin
ajsgja26-Oct-07 21:37
ajsgja26-Oct-07 21:37 
GeneralRe: how????????????? Pin
Imran Khan Pathan26-Oct-07 22:00
Imran Khan Pathan26-Oct-07 22:00 
AnswerRe: how????????????? [modified] Pin
N a v a n e e t h26-Oct-07 21:22
N a v a n e e t h26-Oct-07 21:22 
GeneralRe: how????????????? Pin
ajsgja26-Oct-07 21:39
ajsgja26-Oct-07 21:39 
GeneralRe: how????????????? Pin
J4amieC27-Oct-07 1:12
J4amieC27-Oct-07 1:12 
AnswerRe: how????????????? Pin
John-ph26-Oct-07 21:38
John-ph26-Oct-07 21:38 
GeneralRe: how????????????? Pin
ajsgja26-Oct-07 21:39
ajsgja26-Oct-07 21:39 
GeneralRe: how????????????? [modified] Pin
John-ph26-Oct-07 23:00
John-ph26-Oct-07 23:00 
QuestionCalendar Control Example Pin
PeriyasamyRamachandran26-Oct-07 19:35
PeriyasamyRamachandran26-Oct-07 19:35 
AnswerRe: Calendar Control Example Pin
Member 387988126-Oct-07 19:46
Member 387988126-Oct-07 19:46 
GeneralRe: Calendar Control Example Pin
PeriyasamyRamachandran26-Oct-07 20:24
PeriyasamyRamachandran26-Oct-07 20:24 
AnswerRe: Calendar Control Example Pin
Imran Khan Pathan26-Oct-07 20:04
Imran Khan Pathan26-Oct-07 20:04 
GeneralRe: Calendar Control Example Pin
PeriyasamyRamachandran26-Oct-07 20:26
PeriyasamyRamachandran26-Oct-07 20:26 
GeneralRe: Calendar Control Example Pin
Imran Khan Pathan26-Oct-07 20:42
Imran Khan Pathan26-Oct-07 20:42 
AnswerRe: Calendar Control Example Pin
N a v a n e e t h26-Oct-07 21:38
N a v a n e e t h26-Oct-07 21:38 

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.