SitePoint Sponsor

User Tag List

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

    getting msg even when the condition is false

    if(document.Form1.h_chkcount.value ==0)
    {

    var TermConfirm = confirm(' Jobs not assigned to any user. Do u want to check users')
    document.Form1.h_chkstatus.value=TermConfirm
    if(TermConfirm==true)
    {
    return true


    }
    else
    {

    return false
    }
    }

    else
    {
    return false
    }

    }




    i have the above function where in h_chkcount.value obtained from database.
    i have a check box populated frm database
    the above function is called on submit button click
    if the checkbox values are not checked and submit button clicked i shld get the above msg
    but when checked i shld not get the msg
    now i get msg even when checked

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2009
    Location
    Ottawa, Ontario, Canada
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try putting semicolons ";" at the end of your javascript statements.

    floater


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
  •