title: Function call inside another function not being executed
body: <p>I have a function with 2 blocks, the first one adds html in some page elements, and the second populates the input fields on a form. I cannot get them to work. I mean, only one works at a time.</p>
  
  <pre><code>function popReadMsg(div_id, msg_id, msg, sender, receiver, sent, msg_vid_id) 
  {
  
      $('#msg_sender').html(sender);
      $('#msg_sent').html(sent);
      $('#msg_body').html(msg)
      $('#vid_id').html(vid_id);
  
      // this part does not work unless I remove the top block.
      $('#reply_recipient').prop('value', sender);
      $('#reply_sender').prop('value', receiver);
      $('#reply_vid_id').prop('value', vid_id);
  }
  </code></pre>
  
  <p>I tried wrapping the second block inside a function and call it:</p>
  
  <pre><code>function popReadMsg(div_id, msg_id, msg, sender, receiver, sent, msg_vid_id) 
  {
  
      $('#msg_sender').html(sender);
      $('#msg_sent').html(sent);
      $('#msg_body').html(msg)
      $('#vid_id').html(vid_id);
  
      populateFields(sender, receiver, msg_vid_id);
  }
  
  function populateFields(sender, receiver, msg_vid_id) 
  {
      $('#reply_recipient').prop('value', sender);
      $('#reply_sender').prop('value', receiver);
      $('#reply_vid_id').prop('value', vid_id);
  
  }
  </code></pre>
  
  <p>The HTML:</p>
  
  <pre><code>     &lt;div class="read_more_inner_wrapper"&gt;
                           &lt;p class="output_msg2"&gt;&lt;/p&gt;
                              &lt;table border="0"&gt;
  
                              &lt;tr&gt;
                                  &lt;td&gt;&lt;p id="msg_sender"&gt;&lt;/p&gt;&lt;/td&gt;
                                  &lt;td&gt;&lt;p id="msg_sent"&gt;&lt;/p&gt;&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr&gt;
                              &lt;td&gt;&lt;p id="msg_body"&gt;&lt;/p&gt;&lt;/td&gt;
  
                          &lt;/tr&gt;  
                              &lt;/table&gt;
  
  
                   &lt;/div&gt;
  
                 &lt;div class="hide reply_form" &gt;
  
                 &lt;form class="msg_form" onSubmit="return false"&gt;
                    &lt;input type="text" name="reply_sender" id="reply_sender" &gt;
                     &lt;input type="text" name="reply_recipient" id="reply_recipient" &gt;
                     &lt;input type="text" name="reply_vid_id" id="reply_vid_id"&gt;
                      &lt;textarea id="reply_msg" name="reply_msg" cols="10" rows="10" placeholder="Write your reply here"&gt;&lt;/textarea&gt;
                      &lt;br&gt;
                      &lt;input type="button" onClick="replyMsg();" value="Send"&gt;
                 &lt;/form&gt;
  
  
                  &lt;/div&gt;
  </code></pre>
  
  <p>No success :(  </p>
  
  <p>Any help is welcome,
  Mike</p>