Can anybody give me a tip or somethig … I tried almost everthing …
facts:
I have html page with iframe.
parent form is … <form action=“<!$MG_REQ>” method=“post” id=“VNOS” name=“VNOS” …>
<iframe name=“ifrm” id=“ifrm” …>
iframe form is <form action=“<!$MG_REQ>” method=“post” id=“DELO” name=“DELO” … >
Now (i use iframe document ) … I want to check if some elements in iframe have any value.
for example … this field is in iframe
<input type=“text” class=“inbox” name=“VD” id=“VD” size=“08” maxlength=“03” value=“aa”/>
So what is the JS code to check the value?! If I try standard way like
“document.getElementById(“STRM”).value” … this is not working …
I know how to set value from main form to iframe “top.frames[‘ifrm’].document.getElementById(‘IZBR_STATUS’).value = box[box.selectedIndex].value;” … but If I am on iframe document I can’t check value when I submit iframe … it driving me nuts
It must be simple trick, but I can’t find the solution
Please share some help with me
function whatever(iframeid,iframename){
mmspobj=document.getElementById(iframeid);
if (mmspobj.tagName==‘IFRAME’){
mmsiobj=window.frames[iframename].document.getElementId(‘myfield1ID’).value;
}
}
the examle I posted will retrieve a field value from a field with id=iframename from the iframe with id=iframeid and name=iframeid and assign to variable mmsiobj
this value can be validated or assigned to a hidden field to be validated later with the balance if the form.
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title></title>
</head>
<body>
<p> I want to check a value of an input field (in iframe) if I submit iframe</p>
<iframe name=“fred” src=“my_iframe.html” width=“500” height=“200”></iframe>
I now it’s working … the corect code is:
<script language=“JavaScript” type=“text/javascript”>
<!–
function check_input_value()
{
alert( document.getElementById(“DELO”).VD.value);
}
//–>
</script>
I didn’t get the value because I have had another input field with id=“VD” … lol … stupid … stupid … me (I should see it …)
sorry for bothering you all … sometimes help if you just tell somebody what are your problems