Hi, I have an inline frame within a form. The inline frame actually contains the form element which is generated programatically (a radio which holds a value). How can I retrieve that value hold by the radio from the page which contains that inline frame. Any idea? thanks for reading
This site explains about cross-frame access in JavaScript: http://www.west-wind.com/Weblog/posts/589454.aspx. Be aware that the same-origin policy is enforced; in other words, you cannot access a frame which contains a page loaded from another domain.
What MvanGeest is suggesting is for you to use javascript to transfer values of the radio buttons to a hidden field in your main page form
so for each radio button you would have onclick="valueSet(this.value)"
and in the function valueSet
(that you define in the iframe) you would set the value of the hidden form field
function valueSet(radioValue){
window.parent.document.forms["nameOfYourForm"].elements["nameOfHiddenElement"].value = radioValue;
}
and in the main window, in the FORM you have
<input type="hidden" name="nameOfHiddenElement" value="" />
and you can set the default value for it as well
Don't forget to give your form a name attribute and use that name in the function where it references forms["nameOfYourForm"]
Does that make sense for your project? Or am I totally off base here?