title: How to Save Modal Popup values in Main Page
body: <p>I am trying to save the data which is entered in the modal popup to the main page.
      here is the code for the main page.
  
          
              
                  Company Info
              
              </p>
  
  <pre><code>                &lt;div id="AddMoreDetails"&gt;
                      &lt;div class="table" runat="server" id="AddMore"&gt;
                          &lt;div class="col-md-4"&gt;
                              &lt;div class="row"&gt;
                                  &lt;div class="col-md-12"&gt;
                                      &lt;table style="width:200%;"&gt;
                                          &lt;tr&gt;
                                              &lt;td&gt;Company Name&lt;/td&gt;
                                              &lt;td&gt;Company Address&lt;/td&gt;
                                              &lt;td&gt;Contact&lt;/td&gt;
                                              &lt;td&gt;Company HO&lt;/td&gt;
                                              &lt;td&gt;HO Contact&lt;/td&gt;
                                              &lt;td&gt;Email ID&lt;/td&gt;
  
                                          &lt;/tr&gt;
                                          &lt;tr&gt;
                                              &lt;td&gt;
                                                  &lt;textarea id="TextArea1"&gt;&lt;/textarea&gt;
                                              &lt;/td&gt;
                                              &lt;td&gt;
                                                  &lt;textarea id="TextArea2"&gt;&lt;/textarea&gt;
                                              &lt;/td&gt;
                                              &lt;td&gt;
                                                  &lt;textarea id="TextArea3"&gt;&lt;/textarea&gt;
                                              &lt;/td&gt;
                                              &lt;td&gt;
                                                  &lt;textarea id="TextArea4"&gt;&lt;/textarea&gt;
                                              &lt;/td&gt;
                                              &lt;td&gt;
                                                  &lt;textarea id="TextArea5"&gt;&lt;/textarea&gt;
                                              &lt;/td&gt;
                                              &lt;td&gt;
                                                  &lt;textarea id="TextArea6"&gt;&lt;/textarea&gt;
                                              &lt;/td&gt;
                                          &lt;/tr&gt;
                                      &lt;/table&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                      &lt;div class="col-md-12" style="text-align: right"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-12"&gt;
  </code></pre>
  
  <p>Here is the code for <strong>Modal popup window</strong></p>
  
  <pre><code>&lt;div id="myModalPopup" class="modal fade" role="dialog" data-keyboard="false"&gt; // modal popup window
                          &lt;div class="modal-dialog"&gt;
                               &lt;div class="modal-content"&gt;
                                  &lt;div class="modal-header" style="background-color: orangered; border-top-left-radius: 4px; border-top-right-radius: 4px;"&gt;
                                      &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                                      &lt;h4 class="modal-title"&gt;Company Details&lt;/h4&gt;
                                  &lt;/div&gt;
                                  &lt;div class="modal-body"&gt;
                                      &lt;asp:Panel ID="Panel2" runat="server" class="tab-pane"&gt;
                                          &lt;div class="col-sm-12"&gt;
                                              &lt;div class="row"&gt;
                                                  &lt;div class="col-sm-4"&gt;
                                                      &lt;asp:Label runat="server" ID="lblNmeComp" Text="Name of Company" AssociatedControlID="txtNmeComp" CssClass="control-label" /&gt;
                                                      &lt;asp:TextBox runat="server" ID="txtNmeComp" CssClass="form-control" /&gt;
                                                      &lt;br /&gt;
                                                  &lt;/div&gt;
                                                  &lt;div class="col-sm-4"&gt;
                                                      &lt;asp:Label runat="server" ID="lblAdrComp" Text="Adress of Company" AssociatedControlID="txtAdrComp" CssClass="control-label" /&gt;
                                                      &lt;asp:TextBox runat="server" ID="txtAdrComp" CssClass="form-control" /&gt;
                                                      &lt;br /&gt;
                                                  &lt;/div&gt;
                                                  &lt;div class="col-sm-4"&gt;
                                                      &lt;asp:Label runat="server" ID="lblConctComp" Text="Contact Number" AssociatedControlID="txtConctComp" CssClass="control-label" /&gt;
                                                      &lt;asp:TextBox runat="server" ID="txtConctComp" CssClass="form-control" /&gt;
                                                      &lt;br /&gt;
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                          &lt;/div&gt;
  </code></pre>
  
  <p>Here is the <strong>button code</strong> for <strong>opening Modal popup window</strong></p>
  
  <pre><code>                            &lt;button id="AddMore_Button" class="btn btn-primary" data-target="myModalPopup"&gt;Add More&lt;/button&gt;   &lt;/div&gt;
  
  Here is the button code for saving data from modal popup window.
  
  &lt;button type="button" runat="server" onclick="savepopupdata()"&gt;
  </code></pre>
  
  <p>To get the values from modal popup window I have written a javascript function.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; //Java script function
          function savepopupdata()
          {
              document.getElementById.valueOf(txtNmeComp) = document.getElementById.valueOf(TextArea1);
              document.getElementById.valueOf(txtAdrComp) = document.getElementById.valueOf(TextArea2);
              document.getElementById.valueOf(txtConctComp) = document.getElementById.valueOf(TextArea3);
  
          }
      &lt;/script&gt;
  </code></pre>
  
  <p>But unfortunately it is not saving the data. Any wrong in this code.</p>