www.webdeveloper.com
Results 1 to 5 of 5

Thread: For Loop

  1. #1
    Join Date
    Apr 2010
    Posts
    52

    For Loop

    Please check the code below.....
    the logic being......

    1. if x > y
    eg x=6
    y=4
    I want a message to alert tht "page 5 and page 6 added"

    2. if y<x
    eg y=6
    x= 4
    I want a message to alert tht "page 5 and page 6 deleted"


    code:

    if (x != y)
    {
    if(x > y)
    {
    var a;
    a = (x - y);
    }

    else
    {
    var b;
    b = (y -x);

    }

    }

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Can you be more descriptive, please? What is x? what is y? where do they come from?

  3. #3
    Join Date
    Apr 2010
    Posts
    52
    x and Y both are values entered by the user in text boxes

  4. #4
    Join Date
    Mar 2010
    Posts
    2,803
    if you work down through the various w3schools tutes on functions on the left hand side, you should gain all the skills you need to write your function.

  5. #5
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Quote Originally Posted by hcl.tech View Post
    x and Y both are values entered by the user in text boxes
    And where are the text boxes? Which event the user should apply? onchange? onblur? Or maybe there is a button there to fire onclick a function?

    I suspect you have no idea about JavaScript programming, so that, first at all, take the tirna's advice and learn some JavaScript.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles