...

View Full Version : get selected input field in iframe



guyb
07-21-2009, 07:20 PM
Hello,
I would like to know if there is a way to get the selected input field inside an Iframe from the parent window, is there any way to do that?
Thanks

ckeyrouz
07-21-2009, 07:24 PM
try this:


var zValue = frameName.document.getElementById("inputFieldId").value;

guyb
07-21-2009, 07:35 PM
sorry for not being clear.
I need to get the selected field that the user clicked on inside an iframe.

ckeyrouz
07-21-2009, 07:39 PM
you can do this in you iframe:


<input type="text" onclick="selectObject(this)"></input>




var curObject = null;
function selectObject(obj)
{
curObject= obj;
}


and then in your parent frame you do the following:


if(frameName.curObject != null)
{
var zValue = frameName.curObject.value;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum