Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
function PRODUCT_NAME_POP_onclick(obj) {
         popuptype = "popuptype=product_pop&"
         t_form_name = "Form_name=Sales_Update_form&"

         var cnt = SalesUpdateTabRequest.rows.length - 1;
         temp1 = cnt - 1;

         var temp = obj.parentNode.parentNode.parentNode.rows.length - 1;
         t_id = obj.parentNode.parentNode.rowIndex - 1;
         alert('temp: ' + temp);
         if (t_id == 0) {
             a_ret_val = "a_ret_val=SI_PRODUCT_MASTER_ID,PRODUCT_NAME&"
             var url = "Popups/SO_GenericPopup.aspx?" + popuptype + t_form_name + a_ret_val;
         }
         else {
             alert('TID :' + t_id);
             a_ret_val = "a_ret_val=SI_PRODUCT_MASTER_ID[" + t_id + "],PRODUCT_NAME[" + t_id + "]&"
             var url = "Popups/SO_GenericPopup.aspx?" + popuptype + t_form_name + a_ret_val;
         }
         $("#PRODUCT_NAME_POP").attr("href", url)
         $("#PRODUCT_NAME_POP").colorbox({ iframe: true, width: "80%", height: "80%" });
     }

//I call the above popup in below function :
function AddOnClick(t_setfocus) {

         var arrCellContent = new Array();
         var tabElem = document.getElementById('SalesUpdateTabRequest');

         arrCellContent[0] = "<input type='Checkbox' id='chk_deleteinst' name='chk_deleteinst'>";
         arrCellContent[1] = "<INPUT type='text' name='PRODUCT_NAME' type='text' cssclass='inpTxt' size='10' id='PRODUCT_NAME' readOnly='true'>";
         arrCellContent[1] = arrCellContent[1] + "<INPUT class='arrow' onclick='return PRODUCT_NAME_POP_onclick(this)' type='button' value='...' name='PRODUCT_NAME_POP' id='PRODUCT_NAME_POP'>";
         arrCellContent[1] = arrCellContent[1] + "<input type='hidden' id='SI_PRODUCT_MASTER_ID' name='SI_PRODUCT_MASTER_ID'>";
       
         addNewRowAtEnd(arrCellContent, 'SalesUpdateTabRequest');
     }


first time on add button i am able to get the popup but on 2nd add i get popup but it is getting opened. How can i call 2nd popup?
Posted
Updated 12-Sep-14 21:03pm
v2
Comments
Sinisa Hajnal 16-Sep-14 2:27am    
I'm sorry, I don't understand the question. First time you get the popup, on second add you get popup. It is getting opened. Isn't that the idea? You know click, get the dialog? Or do you mean you want two separate dialogs for the same functionality?
[no name] 24-Sep-14 6:26am    
You have just pasted the code. Please brief the question so that we can answer. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900