[nycphp-talk] More Client-Side Grief
Adam Fields
fields at surgam.net
Tue Oct 29 11:27:21 EST 2002
On Tue, Oct 29, 2002 at 10:57:59AM -0500, Jim Hendricks wrote:
> I'll have to try and find some of my source for this. Don't get me wrong, I
> don't submit the one window to the other. The submit button on the popup
> executes a java script which does:
>
> opener.someform.somehiddenfield.value = mypopup.someform.sometextfield.value
>
> for each field. Then opener.someform.submit();
Two things about this:
1) You often won't want to hardcode the name of the form or the field
- you can pass these values to the popup window (via PHP) to make your
life easier. I randomly generate the name of every form (again, using
PHP) so I can do this using multiple forms and fields and every popup
knows which form and field it goes with.
2) As a point of interest, you can absolutely put the results of a
form in another window.
You can do this by setting the target attribute of the form, either
directly in the form tag or with javascript - it's a property of the
form object.
document.someform.target = 'formtargetwindow';
or some such. When you submit the form, the results will appear in
formtargetwindow.
--
- Adam
-----
Adam Fields, Managing Partner, fields at surgam.net
Surgam, Inc. is a technology consulting firm with strong background in
delivering scalable and robust enterprise web and IT applications.
http://www.adamfields.com
More information about the talk
mailing list