Click here to Skip to main content
15,569,644 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: GridView Editing with VB.NET Pin
MacIntyre1-Jun-09 12:03
MacIntyre1-Jun-09 12:03 
GeneralRe: GridView Editing with VB.NET Pin
ToddHileHoffer1-Jun-09 13:21
ToddHileHoffer1-Jun-09 13:21 
GeneralRe: GridView Editing with VB.NET Pin
MacIntyre1-Jun-09 13:57
MacIntyre1-Jun-09 13:57 
QuestionHow to create forum in asp.net Pin
Saiyed Alam1-Jun-09 7:11
Saiyed Alam1-Jun-09 7:11 
AnswerRe: How to create forum in asp.net Pin
Christian Graus1-Jun-09 12:32
mveChristian Graus1-Jun-09 12:32 
Questionsql query Pin
jainiraj1-Jun-09 7:06
jainiraj1-Jun-09 7:06 
AnswerRe: sql query Pin
Not Active1-Jun-09 8:31
mentorNot Active1-Jun-09 8:31 
QuestionPassing an ID to an external .js file Pin
dwolver1-Jun-09 5:44
dwolver1-Jun-09 5:44 
Want to do clienside validation on a textbox control. This textbox can represent two data types depending on an associtate checkbox. So if checkbox is checked the validation should do (a) and if off do (b)

In the javascript funtion below I do a getElementForID("chkBox1")
However if I want this to be a global routine I don't know what the checkBox would be
and preferably I'd like to pass an Integer so I could do multiple validations on this control or others. The "Sender" parameter seems to be my textbox, So question is how do I setup the ClientValidationFuntion property of the validator to pass an integer?  

My custom validator is setup like this

<asp:CustomValidator ID="lsdCustomVal" ControlToValidate="txtBox1" runat="server"
                     ClientValidationFunction= "validateLSDControl"></asp:CustomValidator>


in my external js file I have >>

function validateLSDControl( sender, args)
{
      var expr1 = "[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9]";
      var expr2 = "[a-z]-[0-9][0-9][0-9]-[A-Z]/[0-9][0-9]";
      var x = document.getElementById(sender.controltovalidate);
      var chkbox = document.getElementById("chkBox1");
      var smsg = "";
      if (chkbox.checked) {
            var patt1 = new RegExp(expr, "g");
            smsg = "expr1 Invalid";
      }
      else {
            var patt1 = new RegExp(nts, "g");
            smsg = "expr2 Invalid";
      }
           
      var result = false;
      if (x != null) {
            var s = x.value;
            if (s.match(patt1))
            {
//                  alert("it worked");
                  result = true;                 
            }              
            else
                  alert(smsg);

      }
      args.isValid = result;
}
AnswerRe: Passing an ID to an external .js file Pin
RajeevKumarSharma2-Jun-09 0:19
RajeevKumarSharma2-Jun-09 0:19 
QuestionGridview in ASP.Net with C# [modified] Pin
mahichandu1-Jun-09 5:18
mahichandu1-Jun-09 5:18 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello1-Jun-09 10:24
Ibrahim Bello1-Jun-09 10:24 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu1-Jun-09 10:40
mahichandu1-Jun-09 10:40 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello1-Jun-09 23:04
Ibrahim Bello1-Jun-09 23:04 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu2-Jun-09 7:36
mahichandu2-Jun-09 7:36 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello2-Jun-09 8:03
Ibrahim Bello2-Jun-09 8:03 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu2-Jun-09 8:19
mahichandu2-Jun-09 8:19 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello2-Jun-09 8:31
Ibrahim Bello2-Jun-09 8:31 
QuestionRe: Gridview in ASP.Net with C# Pin
mahichandu2-Jun-09 8:48
mahichandu2-Jun-09 8:48 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello2-Jun-09 9:09
Ibrahim Bello2-Jun-09 9:09 
AnswerRe: Gridview in ASP.Net with C# Pin
Ibrahim Bello3-Jun-09 23:08
Ibrahim Bello3-Jun-09 23:08 
QuestionUnable to connect to SQL Server database. Pin
Koss_G1-Jun-09 5:01
Koss_G1-Jun-09 5:01 
AnswerRe: Unable to connect to SQL Server database. Pin
Herman<T>.Instance2-Jun-09 22:54
Herman<T>.Instance2-Jun-09 22:54 
QuestionHidden Field problem Pin
ais071-Jun-09 4:58
ais071-Jun-09 4:58 
AnswerRe: Hidden Field problem Pin
l.laxmikant1-Jun-09 5:33
l.laxmikant1-Jun-09 5:33 
GeneralRe: Hidden Field problem Pin
Not Active1-Jun-09 8:50
mentorNot Active1-Jun-09 8:50 

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.