Closed Thread Icon

Topic awaiting preservation: php-variables in different windows Pages that link to <a href="https://ozoneasylum.com/backlink?for=11945" title="Pages that link to Topic awaiting preservation: php-variables in different windows" rel="nofollow" >Topic awaiting preservation: php-variables in different windows\

 
Author Thread
GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-08-2001 18:46

hello everyone, this is my weekly php-problem.

ok, i have a script on a page where you can fill in some values via a form and on the bottom there is the submit button, which inserts the values in the mysql-db.

somewhere on the page is another button which opens up a new window using javascript. on this pop-up you can also fill in values into a form and after you press the submit button on this new window the values should also be available in the mother-window for inserting them into the db.

so how do i get the new values in the mother-window?



Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 12-08-2001 20:24

You'll need JavaScript to do that.

Emps

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 12-08-2001 20:26

This is actually a Javascript problem if you want the values availible without refreshing the mother page.

But what you want to happen is set the form values when you submit the popup's form.
This would set the first elements value on the parent page with the value of the field of the first element on the popup

something like this.

function passToMom(form) {
window.opener.forms[0].elements[0].value = form.elements[0],value;
return false
}

then put this in the popup's form element <form onSubmit="return passToMom(this)">



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-09-2001 14:56

thanks for your help first of all!
is there no way around javascript?

in my case the pop-up window contains a dynamically generated table with n*m columns and rows. so im using a 2-dimensional array as variable:
<input type=text name=<? $content[$n][$m] ?>>

so, the problem is, the convertion from php to javascript and back to php in the end.
and the number of variables(n,m) is dynamically, so it's difficult to write a JS-function for this.
any ideas?



« BackwardsOnwards »

Show Forum Drop Down Menu