0

I have a page located in an iframe of another page. It calls a js function like this:

function F(a)  
{  
    parent.document.getElementById('A').value = a;
    parent.document.getElementById('B').click();
}

It results in page reloading. How can I prevent it? Previously I've used return false; and it worked. But not in this case.

1 Answer 1

1

F("some value"); return false; after calling the function not inside.

Sign up to request clarification or add additional context in comments.

7 Comments

Function is called when link clicked. <a href="javascript:F('qwerty');>Link</a>. So if I add return false; here it will not work.
<a href="javascript:F('qwerty'); return false;">Link</a>
Nothing happens when I click it.
are you handling the onclick of your botton? in my replicated example I have this: <input type="button" id="B" onclick="foo();" /> So when I call F function the click of B input call the foo function.
I'm using asp.net button <asp:Button ID="B" runat="server" Text="Button" onclick="B_Click" />
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.