Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 71679

Forum Post: RE: want to pass 2 parameter at on-load in javascript function

$
0
0
Hi Tin, in the other thread I answered the question on how to pass parameters from the ribbon. In this thread I'll try to answer your question on receiving the values In the form you can do something like this ** * Get the value of a querystring * @param {String} field The field to get the value of * @param {String} url The URL to get the value from (optional) * @return {String} The field value */ var getQueryString = function ( field, url ) { var href = url ? url : window.location.href; var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' ); var string = reg.exec(href); return string ? string[1] : null; }; Let’s say your URL is http://example.com&amp ;this=chicken&that=sandwich. You want to get the value of this, that, and another. var thisOne = getQueryString('this'); // returns 'chicken' var thatOne = getQueryString('that'); // returns 'sandwich' var anotherOne = getQueryString('another'); // returns null I hope this helps you further Bas

Viewing all articles
Browse latest Browse all 71679

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>