How to pass multiple prams to javascript function from anchor tag -


i have anchor tag having onclick event below

<a id="btnsave" href="javascript: void[0];" onclick="btnsave(id,email ,companyname,address)" />  function btnsave(id, email, companyname, address) {   alert(id, "+", email, "+", companyname, "+", address); } 

in view storing these values in hidden field. unable values in btnsave function while clicking on anchor tag. please me solve this.

the onclick event handler function doesn't know id, email, companyname or address are. undefined variables @ point.

retrieve values of fields using document.getelementbyid() , querying value attribute, , pass them on function.

onclick="btnsave(document.getelementbyid('id').value, ...); return false;" 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -