What's your strategy for passing parameters to unobtrusive Javascript?
Say we have three dynamically generated input fields which need to be validated for ranges:
<input id="smallValue" class="validatedRange" />
<input id="mediumValue" class="validatedRange" />
<input id="largeValue" class="validatedRange" />
In the Javascript:
Ext.onReady(function () {
Ext.select("input.validatedRange").on("change", function () {
// How to get the min/max values to here?
});
});
Somehow, the min/max values need to be included in the markup. The "best" way I see currently is to abuse the tag like so:
<input id="smallValue" class="validatedRange" min="0" max="10" />
<input id="mediumValue" class="validatedRange" min="100" max="1000" />
<input id="largeValue" class="validatedRange" min="1000" max="10000" />
Do you know of a better way?