Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Paste link from iframe to a form field

    Hello,

    I want add an onclick link from an iFrame to a form field on the parent. After to ba placed on the form field, clicking on the link a new page will be open on the iframe. I am trying this:

    <form name=formName>
    <iframe name=frameName src="<a href=http://www.google.com onclick="parent.document.forms['formName'].elements['fieldName'].value = 'do you right';" return false;">Click Here To Get Done Right</a>
    " width="800" height="400" ></iframe><br><br>
    <input type="text" id="fieldname" size="95" name="t2">

    </form>

    letchev

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    The src= for an <iframe> *MUST* be a URL. Only. Can't be an HTML tag.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Aug 2010
    Location
    FL
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post
    The src= for an <iframe> *MUST* be a URL. Only. Can't be an HTML tag.
    letchev:

    To fix your problems, follow what Old Pedant said but to achieve your result. What you could do is use some javascript to find the <a> tag or all <a> tags within the iframe and add an onClick event to them.


  •  

    Posting Permissions

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