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

09-01-2010, 02:29 AM

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">



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

09-01-2010, 02:35 PM
The src= for an <iframe> *MUST* be a URL. Only. Can't be an HTML tag.


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