SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    function does not fired

    i have few javascript functions for validation
    txtQty.Attributes.Add("onblur", "javascript:ValidateQty();")
    txtAdjPart.Attributes.Add("onblur", "javascript:ValidatePart();")

    i have called this on a command button click

    but it doesnot get fired

    even on the blur of the individual txt control the function doesnot get fired

  2. #2
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    265
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi
    Try use the Firebug addon in Mozilla browser to debug the javascript code.
    In console you'll see if there is errors in JS script, and which line.
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners

  3. #3
    SitePoint Guru
    Join Date
    Dec 2008
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MarPlo View Post
    Hi
    Try use the Firebug addon in Mozilla browser to debug the javascript code.
    In console you'll see if there is errors in JS script, and which line.
    the function has no errors .
    it gets fired if there is focus on it

    wht i need is even if the user doesnot foucs on the textcontrols & directly clicks the command button i still need the validations of text controls to take place

  4. #4
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    265
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi
    Just add an "onclick" event to that button, to call the validation function.
    Something like this in js code:
    Code:
    cument.getElementById('id_button').onclick = function(){ return functionName();};
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •