Passing value of a variable
Posted: Fri Sep 18, 2009 3:31 pm
I apologyze for writing again, but I realized that my previous email was not clear enough to illustrate the problem.
I report here the file "sample.php":
<html>
<head>
<script>
function doIt()
{
factory.printing.leftMargin = .25;
var marleft=factory.printing.leftMargin;
var deltaleft = 25.4 * (marleft-.25);
fr1.focus();
factory.printing.Print(true,fr1);
}
</script>
</head>
<body>
<!-- MeadCo smsx -->
<object id='factory' viewastext style='display:none'
classid='clsid:1663ed61-23eb-11d2-b92f-008048fdd814'
codebase='smsx.cab#Version=6,5,439,12'>
</object>
<form name="inputform" action="sample.php" method="post">
<?
$box++;
echo "<input type='text' name='box' value='$box' >" ;
$deltaleft = document.inputform.deltaleft;
echo "<input type='hidden' name='document.inputform.deltaleft' value='$deltaleft' >" ;
?>
<input type='submit' onclick='doIt()'>
</form>
<iframe name="fr1" id="fr1" src="pop.html"></iframe>
</body>
</html>
By clicking on the form button the program runs the script, computing the var "deltaleft".
Now I would like to pass this variable sitting on the script into the body, in order then to pass the value of this variable to the Iframe file pop.html.
Unfortunately the Iframe does not show this value (most likely because the value is not being passed).
In this case is not a passing from one page to the next, but rather from a page script into another portion of the same page.
(For calculating "deltaleft" I use an object from the UK company MeadCo, which calculates the margin setting within a paper page).
The following is the Iframe source "pop.html" :
<html>
<body>
<script>
box = parent.document.inputform.box.value;
document.write("box = "+box);
deltaleft = parent.document.inputform.deltaleft.value;
document.write ("deltaleft = "+ deltaleft);
</script>
</body>
</html>
Thank you every person for any support or hint etc
Regards
Gian
I report here the file "sample.php":
<html>
<head>
<script>
function doIt()
{
factory.printing.leftMargin = .25;
var marleft=factory.printing.leftMargin;
var deltaleft = 25.4 * (marleft-.25);
fr1.focus();
factory.printing.Print(true,fr1);
}
</script>
</head>
<body>
<!-- MeadCo smsx -->
<object id='factory' viewastext style='display:none'
classid='clsid:1663ed61-23eb-11d2-b92f-008048fdd814'
codebase='smsx.cab#Version=6,5,439,12'>
</object>
<form name="inputform" action="sample.php" method="post">
<?
$box++;
echo "<input type='text' name='box' value='$box' >" ;
$deltaleft = document.inputform.deltaleft;
echo "<input type='hidden' name='document.inputform.deltaleft' value='$deltaleft' >" ;
?>
<input type='submit' onclick='doIt()'>
</form>
<iframe name="fr1" id="fr1" src="pop.html"></iframe>
</body>
</html>
By clicking on the form button the program runs the script, computing the var "deltaleft".
Now I would like to pass this variable sitting on the script into the body, in order then to pass the value of this variable to the Iframe file pop.html.
Unfortunately the Iframe does not show this value (most likely because the value is not being passed).
In this case is not a passing from one page to the next, but rather from a page script into another portion of the same page.
(For calculating "deltaleft" I use an object from the UK company MeadCo, which calculates the margin setting within a paper page).
The following is the Iframe source "pop.html" :
<html>
<body>
<script>
box = parent.document.inputform.box.value;
document.write("box = "+box);
deltaleft = parent.document.inputform.deltaleft.value;
document.write ("deltaleft = "+ deltaleft);
</script>
</body>
</html>
Thank you every person for any support or hint etc
Regards
Gian