mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-05-06 05:17:32 -05:00
Force max level to be >= min level.
This commit is contained in:
parent
bf5c3a85bf
commit
aebe8ee6ee
|
|
@ -16,9 +16,40 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function ()
|
||||
{
|
||||
$("#<%= txtLevelMin.ClientID %>").spinner();
|
||||
$("#<%= txtLevelMax.ClientID %>").spinner();
|
||||
betterSpinner($("#<%= txtLevelMin.ClientID %>"));
|
||||
betterSpinner($("#<%= txtLevelMax.ClientID %>"));
|
||||
});
|
||||
|
||||
function betterSpinner(input)
|
||||
{
|
||||
input.spinner(
|
||||
{
|
||||
spin: function(event, ui)
|
||||
{
|
||||
input.val(ui.value);
|
||||
input.change();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function changedMax(idMin, idMax)
|
||||
{
|
||||
var minValue = parseInt($("#" + idMin).val(), 10);
|
||||
var maxValue = parseInt($("#" + idMax).val(), 10);
|
||||
|
||||
if (minValue > maxValue)
|
||||
$("#" + idMin).val(maxValue);
|
||||
}
|
||||
|
||||
function changedMin(idMin, idMax)
|
||||
{
|
||||
var minValue = parseInt($("#" + idMin).val(), 10);
|
||||
var maxValue = parseInt($("#" + idMax).val(), 10);
|
||||
|
||||
if (minValue > maxValue)
|
||||
$("#" + idMax).val(minValue);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<form id="theForm" runat="server">
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ namespace PkmnFoundations.GTS
|
|||
rptPokemon.DataSource = records5;
|
||||
rptPokemon.DataBind();
|
||||
}
|
||||
|
||||
txtLevelMin.Attributes["onchange"] = "changedMin(\'" + txtLevelMin.ClientID + "\', \'" + txtLevelMax.ClientID + "\');";
|
||||
txtLevelMax.Attributes["onchange"] = "changedMax(\'" + txtLevelMin.ClientID + "\', \'" + txtLevelMax.ClientID + "\');";
|
||||
}
|
||||
|
||||
private String FormatLevels(byte min, byte max)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user