1 // IEprompt Callback function to handle choose random prime request
2 function promptCallback(val) {
7 if ( size == "" ) alert("Must enter nonnegative integral value");
9 else if ( isNumeric(size) ) {
10 if (size > 1400) alert("Size too large. Please choose one <= 1400");
12 document.demoform.primesize.value=size;
13 document.demoform.buttontype.value="Random";
14 document.demoform.submit();
18 alert("Must enter nonnegative integral value");
23 <!-- Check non-negative nemeric -->
24 function isNumeric(sText)
26 var ValidChars = "0123456789";
30 for (var i = 0 ; i < sText.length && IsNumber == true; i++)
32 Char = sText.charAt(i);
33 if (ValidChars.indexOf(Char) == -1)
42 String.prototype.trim=function(){
43 return this.replace(/^\s*|\s*$/g,'');
46 String.prototype.ltrim=function(){
47 return this.replace(/^\s*/g,'');
50 String.prototype.rtrim=function(){
51 return this.replace(/\s*$/g,'');