How do you submit a form to a new javascript popup window? (php)

Suspended
Joined
26 Jul 2003
Posts
6,348
Location
Surrey
Ok here is my problem. I got a fault reporting system, I want a quick search option on the main screen. You fill in say a fault ID, click the Go button.

I want this to popup a new window that doesnt have address bar etc (using javasript window.open) and have the result. The parent window can just remain unchanged or refresh itself.

Cant seem to find the solution to this while googling - except maybe that annoying POS experts exchange place that expects you to cough up a monthly sub.
 
Associate
Joined
30 Jul 2003
Posts
2,267
Someone will probably come back with a more sensible option but off the top of my head:

Give the form an onsubmit(); that returns false so that the form doesn't actually submit if javascript is enabled, in the function called by the onsubmit read the form details and add them to a url query string then open the popup window to the newly built url.
 
Suspended
OP
Joined
26 Jul 2003
Posts
6,348
Location
Surrey
well I have just managed to cludge together from various example javascripts the following:

Code:
var fault_id = jsform.fault_id.value;
var valform = "update.php?fault_id=" + fault_id;
myWindow = window.open(valform, 'new','width=800,height=525,resizable=yes')

Not sure if this is the best way tho - but it works.
 
Back
Top Bottom