Get value from custom javascript

  • 9 March 2018
  • 4 replies
  • 84 views

Badge +4

Hi all, if i have a custom javascript which is call a web service and return a string "HelloWord", how can i display the string to the form label control? thanks.

 

function fun() 
{
   var data="hello";  
   $
.get("http://localhost/ws/service.asmx/HelloWord", function(response) {
            
data = response;  
      
}).error(function(){ 
      alert
("Sorry could not proceed");
      
});   
   return data;
}

4 replies

Badge +7

NWF$("#" + yourcontrolName).val(YourValue);

Userlevel 1
Badge +5

hi Joe,

refer to this link

 

regards,

race eka patria

Hi Ranjith Can you tell me in Javascript how to block a user from submitting the form if some fields are not filled in?

i tried event.preventDefault(); but this hang at saving dialog and user cannot go back and fill the form and retry.

Hi Reva Can you tell me in Javascript how to block a user from submitting the form if some fields are not filled in?

i tried event.preventDefault(); but this hang at saving dialog and user cannot go back and fill the form and retry.

Reply