0

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"].

Rob Lyndon
12.7k5 gold badges56 silver badges79 bronze badges
asked Jan 21, 2017 at 10:06
2
  • 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'); Commented Jan 21, 2017 at 10:08
  • Thank you very much Commented Jan 21, 2017 at 10:11

1 Answer 1

3

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');
answered Jan 21, 2017 at 10:09
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.