href and onClick.............

Discussion in 'Javascript' started by soyo, Feb 7, 2006.

  1. soyo

    soyo Guest

    I have a web page which has two frames. top frame has an image(img1)
    for decreasing order
    on click of this image it should:
    --it should put the records in the bottom frame in descending order
    --Change the image in the top frame to an img2(ie., for incresaing
    order)

    Now on clicking this image(img2) it should also do two things:
    --it should order the records in the below frame to increasing order.
    --Change the image in the top frame to img1(for decreasing order)

    the code I wrote for this is as below:

    <a id="check" href="javascript:script1();"><img src='/images/img1.gif'
    name="dsort" onClick="dsort.src='/images/img2.gif';" border="0"></a>"

    the required javascript is:

    function script1()
    {
    mainframes['bodyFrame'].actualframes['mainbody'].location =
    "/Customers/Order.html?sort=Y&Column=Amount&sortOrder=descending";
    }

    the way it works is:
    when I click on "img1" immediately the "img1" gets swapped with "img2"
    and then when the page completely loads it again loads the previous
    image ie., "img1" and puts the records in the descending order ie.,in
    the order I wanted.

    What I want the functionality to be:
    OnClick of "img1" it should change the image to "img2"
    and the bottom frame should have the ordered records and as opposed to
    how its working now the image should not change to the original image.

    can someone show me what's the mistake i'm doing
    any help would be greatly appreciated
     
    soyo, Feb 7, 2006
    #1
    1. Advertising

  2. soyo

    Matt Kruse Guest

    Matt Kruse, Feb 7, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CRON
    Replies:
    24
    Views:
    202,055
    Adrienne Boswell
    Jun 20, 2006
  2. Soren Vejrum
    Replies:
    4
    Views:
    674
    Lasse Reichstein Nielsen
    Jul 5, 2003
  3. saiho.yuen
    Replies:
    3
    Views:
    458
    kaeli
    Sep 14, 2004
  4. Replies:
    2
    Views:
    511
  5. Vincent van Beveren

    BASE HREF and A HREF="#" onclick="..."

    Vincent van Beveren, Jul 6, 2006, in forum: Javascript
    Replies:
    2
    Views:
    346
    Vincent van Beveren
    Jul 6, 2006
Loading...

Share This Page