load a page in different frame using href in anchor tag

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sindhu
    New Member
    • Oct 2006
    • 53

    load a page in different frame using href in anchor tag

    Hello,
    I'm loading a frame from another frame using anchor tag.
    the code is as folllows.

    [code=javascript]
    function change_page
    {
    if(document.for m.txtbx1.value= ="all")
    {
    document.getEle mentById('a_lin k').target="rig ht_bottom";
    document.getEle mentById('a_lin k').href="resul ts.html";
    }else
    {
    alert("message ");
    }
    }

    [/code]

    [code=html]
    <a name="a_link" >Call Page</a>
    <button type='text' name='txtbx1'/>
    [/code]
    here "right_bott om" is the name of the frame where i want to load the page.
    the problem i'm facing is. when i call the function if the condition in if is true it calls the page by replacing the page that is present at the 'roght_bottom' frame. if the condition is not satisfied it doesn't change the page only if the condition was not met earlier.
    i mean if the right_bottom page was replaced earlier , irrespective of whether the condition is met the right_bottom frame is loaded with the new page 'results.html' which i dont want please tel me the solution.
    is the page being stored when the condition is met and it is being flashed even on not meeting the condition??????
    thanks in advance
    Last edited by gits; Feb 25 '08, 02:42 PM. Reason: fix code tags
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Add return false; after alert("message "); in the same loop.

    and add onclick="return change_name()" in the link tag.

    Comment

    • sindhu
      New Member
      • Oct 2006
      • 53

      #3
      thanks alot
      it works,
      works fine

      Originally posted by hsriat
      Add return false; after alert("message "); in the same loop.

      and add onclick="return change_name()" in the link tag.

      Comment

      Working...