Abhijit  Patil

Abhijit Patil

  • NA
  • 3.8k
  • 1.6m

how to call another js function in another function

Apr 14 2015 5:02 AM
i have two javascript function
i want to call getvalue(obj) function in another function  testKeyEvent (e)   .how to call getvalue(obj) function in testkeyEvent(e) Function.


 <script type="text/javascript">
         function getValue(obj) {
             var clientid = obj.id
           //  document.getElementById('myHiddenField').value = obj.id;
             document.getElementById('HiddenField1').value = obj.id;

           //  HiddenField1.value = obj.id;
             alert(obj.id);
         }
         </script>
                       





  function testKeyEvent(e) {


           var txt = document.forms[0].getElementsByTagName("input");
           if (e.keyCode == 13) //We are using Enter key press event for test purpose.
           {
               // alert('Enter key pressed');
               document.getElementById('myHiddenField').value = "Enter";
               document.getElementById('HiddenField1').value = funname.obj.id;
               alert(funname.obj.id);                                                                                                                                                                                                 

Answers (1)