Re: How to change value of input on form from iframe?
| From: | elias | Date: | Tue, 15 May 2001 20:41:10 +0000 |
| Subject: | Re: How to change value of input on form from iframe? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52831@lists.php.net to get a copy of this message | ||
argh!
consider these two files man! i think i even answered you from the first
post,...
test1.html
--------
<html>
<head>
<title> New Document </title>
</head>
<body>
<form name="form1">
<input type="button" value="from ifram to main form"
onclick="form1.txt1.value = iframe2.document.form2.txt1.value;">
<input type="text" name="txt1">
</form>
<iframe src="test2.html" name="iframe2">
</body>
</html>
test2.html
--------------
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
</head>
<body>
this is test2
<form name="form2">
<input type="text" name="txt1" value="Hello man! you could have
asked
this from the beginning!;">
</form>
</body>
</html>
-elias
http://www.eassoft.cjb.net
"Dezider Góra" <gora@wittmann.sk> wrote in message
news:3B00DFE3.6BDBC692@wittmann.sk...
> Hi, thanks for the effort.
> The only thing I need is to store the value of the second combo that is
inside
> of the iframe to the hidden textbox which is in the main form so I can
send
> it's value with the main form for further processing.
> I just can't seem to find the correct syntax for this.
>
> Anybody can help?
> tia
> Dezider.
>
> > > the main page:
> > >
> > > <HEAD>
> > > <?
> > > echo "<SCRIPT LANGUAGE=\"JAVASCRIPT\">";
> > > echo "function requery(country_id)";
> > > echo "{";
> > > echo "document.all.operator.src=\"getoperators.php?id=\" +
country_id;";
> > >
> > > echo "}";
> > > echo "</SCRIPT>";
> > > ?>
> > > </HEAD>
> > > <BODY>
> > > .
> > > .
> > > .
> > > <TD WIDTH="150"><B>Operátor</B></TD>
> > > <TD>:</TD>
> > > <TD><IFRAME name="operator"
> > > "id="operator"
> > > SRC="getoperators.php" FRAMEBORDER=NO SCROLLING=NO HEIGHT="22"
> > > WIDTH="200"></IFRAME></td>
> > > </TR>
> > > <TR>
> > > <TD COLSPAN="3">
> > > <INPUT TYPE="HIDDEN" NAME="operatorid"
> > > id="operatorid"
> > > VALUE="0">
> > > <input type="SUBMIT" value="Send">
> > > </td>
> > > </TR>
> > >
> > > getoperators.php is:
> > >
> > > <HTML>
> > > <HEAD>
> > > <SCRIPT language="Javascript">
> > > function savevalue(oper_id)
> > > {
> > > alert (oper_id)
> > > document.forms["newphone"].operatorid.value=oper_id;
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > PLEASE how to correct this?
> > > }
> > > </SCRIPT>
> > > </HEAD>
> > > <?
> > > include "../../include/data_mysql.php";
> > > $objData = new mysql_db;
> > > $objData->init();
> > > $sqlstring = "select * from cell_operators where country = $id";
> > > $obj_str = "<SELECT NAME=\"operid\" TABINDEX=\"1\"
> > > SIZE=\"1\"
> > > style=\"position: absolute; top: 0px; left: 0px\"
> > > onChange=\"savevalue(this.value)\"><OPTION
> > > VALUE=\"0\">nie
je</OPTION>";
> > >
> > > if ( $objData->query($sqlstring) ):
> > > # Create a list from results
> > > while ( $objData->movenext() == False ){
> > > $obj_str .= "<OPTION VALUE=\"" . $objData->value(
> > > "id" ) .
> > > "\">" . $objData->value( "cell_prefix" ) . ' -
> > > ' . $objData->value(
> > > "description" ) . "</OPTION>";
> > > }
> > > endif;
> > > $obj_str .= "</SELECT>";
> > > echo $obj_str;
> > > ?>
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>