Yammaski
02-17-2011, 02:29 PM
The alert should appear when the text is longer then the maximum characters for the choosen width.
E.g.: choosen width is 15 cm, the max is 15 characters.
Prototype (http://www.frogstyling.be/X_Tests/maxCharsCheck.asp)
Nearly ...
But in stead of ???, I need the value of "var maxChars".
<script>
<!--
function checkchars(cur){
var e = document.getElementById("FrogStyling_1_Size_Add");
var maxChars = e.options[e.selectedIndex].value;
var maxlength=maxChars
if (cur.AddText.value.length>maxlength){
alert("Please restrain your input to ??? or less characters !")
return false
}
}
//-->
</script>
Yam.
E.g.: choosen width is 15 cm, the max is 15 characters.
Prototype (http://www.frogstyling.be/X_Tests/maxCharsCheck.asp)
Nearly ...
But in stead of ???, I need the value of "var maxChars".
<script>
<!--
function checkchars(cur){
var e = document.getElementById("FrogStyling_1_Size_Add");
var maxChars = e.options[e.selectedIndex].value;
var maxlength=maxChars
if (cur.AddText.value.length>maxlength){
alert("Please restrain your input to ??? or less characters !")
return false
}
}
//-->
</script>
Yam.