...

View Full Version : Paste link from iframe to a form field



letchev
09-01-2010, 03:29 AM
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:confused:

Old Pedant
09-01-2010, 06:34 AM
The src= for an <iframe> *MUST* be a URL. Only. Can't be an HTML tag.

codebyter
09-01-2010, 03:35 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum