SitePoint Sponsor

User Tag List

Page 5 of 5 FirstFirst 12345
Results 101 to 112 of 112
  1. #101
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Paul,
    Ok it works. So once it sees the same thing I give a pop-up message that is fine right.

  2. #102
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by newtomysql View Post
    So once it sees the same thing I give a pop-up message that is fine right.
    Yes, and you can then break out of the loop at the same time too.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #103
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Paul,
    Thank you. I got one more problem. Where I built table base on ajax calling but when I submit the reference show empty to the table what could be problem? Thank you.

  4. #104
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by newtomysql View Post
    I got one more problem. Where I built table base on ajax calling but when I submit the reference show empty to the table what could be problem?
    For some reason I'm not understanding what you mean there.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #105
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear PAul,
    I have a piece of code as below. When the alert is shown up it give me null? But the table listOfCorrection is built dynamically based on ajax call.


    var table = document.getElementById("listOfCorrection");
    //var checkbox = table.getElementsByTagName("input");
    alert("tableContent:"+table);

  6. #106
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by newtomysql View Post
    Dear PAul,
    I have a piece of code as below. When the alert is shown up it give me null? But the table listOfCorrection is built dynamically based on ajax call.
    Where and when are you alerting that? Or in other words, do you have a test page that can help us to troubleshoot the problem for you? I don't see it anywhere on your current page.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #107
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Paul,
    Here is my page http://183.78.169.54/v3/addCVC.php. First your select T1 from the first drop down list then the second drop down list will be populated then from the second drop down list you can select any value and you will get a table. This talble is where I reference in the validation function. Thank you.

  8. #108
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by newtomysql View Post
    Dear Paul,
    Here is my page http://183.78.169.54/v3/addCVC.php. First your select T1 from the first drop down list then the second drop down list will be populated then from the second drop down list you can select any value and you will get a table. This talble is where I reference in the validation function. Thank you.
    The reason why you are getting null is because that section of the page no longer exists, so that is no longer any element with the id that you are looking for.

    Why does is no longer exist? It's due to this assignment which removes the content:

    Code:
    if(clientViolationCorrectionControl.innerHTML="")
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  9. #109
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Paul,
    Thanks that helped. Addition to that I have this codes to check is the checkbox have been checked is this valid?

    var table = document.getElementById("listOfCorrection");
    var checkbox = table.getElementsByTagName("input");
    alert("tableContent:"+table);

    for (var i = 0; i < checkbox.length; i++)
    {

    if (checkbox[i].type == "checkbox")
    {
    alert("checxbok");

    }

    alert(checkbox[i].checked);

    }

  10. #110
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by newtomysql View Post
    Thanks that helped. Addition to that I have this codes to check is the checkbox have been checked is this valid?
    Valid has several different confusing meanings. Do you mean to ask if it will be interpreted without fault by the scripting engine?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  11. #111
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    874
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear Paul,
    Valid here in a sense whethere I am doing the correct method to check whether checkboxes have been checked or not?

  12. #112
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by newtomysql View Post
    Valid here in a sense whethere I am doing the correct method to check whether checkboxes have been checked or not?
    You'll want to move the second alert inside the if statement, so that it only occurs when it comes across a checkbox.

    From there though, how you want to handle things is up to you.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •