Sanju Menon
Sanju Menon

Reputation: 729

Javascript pop up window script

I am trying to write a javascript code for opening a popup window. It has to pass 2 parameters to the php script.

Here is the snippet of the code:

window.open('commercial_files/ttform.php?tender_id='+result["tender_id"]&id='+result["id"], 'quotation','scrollbars=yes','menubar=no','status=no','width=800,height=600');

There is some problem with comma and apostrophe near "?". tender_id='+result["tender_id"]&id='+result["id"].

Upvotes: 0

Views: 54

Answers (1)

Pranav Patel
Pranav Patel

Reputation: 1559

you have missed ' for &id in

tender_id='+result["tender_id"]&id='+result["id"],

---------------------------------------------^^^----------------------

it should be like

window.open('commercial_files/ttform.php?tender_id='+result[‌​"tender_id"]+'&id='+‌​result["id"], 'quotation','scrollbars=yes','menubar=no','status=no','width‌​=800,height=600');

Upvotes: 3

Related Questions