i learned a nice little trick today...i had searched on the forum for an hour today trying to find something along these lines...but no luck...
what i'm doing...is a little order entry system...a user makes some selections on page (which is a frame) and then it's ready to create a work order...however, they still need to select (or create) the customer...and then after they select the client it passes the customer_id back to the frame page, closes the popup window and then submits the form...i didn't want the page refreshing because i would lose all the things that the user had selected...
so...a popup comes up (from a button) where the user selects the customer...in the pop there is a javascript function...
function changeCust(cust) {
opener.document.form1.custa.value = cust
opener.document.form1.submit()
window.close()
}
when the user finds the customer they want...they get a link...
<a href="javascript:changeCust('<? echo $row_cust['cust_id']; ?>');">Create work order</a>
then...in the parent (opener) frame...i get the value this way...
<input type="textfield" name="custa" value="" onchange="changeCust(Cust)">
and it submits away! my initial testing is showing that it's working on the major browsers and i don't have reason to believe it won't on most normal ones...
one could also easily stop the form from submitting by deleting out the submit line...
just thought i would share...maybe somebody (like me) might need to look this up another day...heh...v
ps: thanks jerom