Rashar
12-08-2003, 10:10 AM
Looking to add script to the following code that will check for a duplicate entry, and alert the end user that a duplicate entry has been made. Thanks in advance.
<script language = "javascript">
function validateChoice()
{
// Get the source element.
var choice = event.srcElement;
// Valid numbers
var num = "0123456789";
event.returnValue = true;
/* Loop over Choices. If any Choice selected is not a number,
set the return value to false. */
for (var intLoop = 0; intLoop < choice.value.length; intLoop++)
if (-1 == num.indexOf(choice.value.charAt(intLoop)))
event.returnValue=false;
if (!event.returnValue) // Bad value
choice.className = "badValue"; // change colour of incorrect choice.
else
// Clear class to use default rendering.
choice.className="";
}
</SCRIPT>
<script language = "javascript">
function validateChoice()
{
// Get the source element.
var choice = event.srcElement;
// Valid numbers
var num = "0123456789";
event.returnValue = true;
/* Loop over Choices. If any Choice selected is not a number,
set the return value to false. */
for (var intLoop = 0; intLoop < choice.value.length; intLoop++)
if (-1 == num.indexOf(choice.value.charAt(intLoop)))
event.returnValue=false;
if (!event.returnValue) // Bad value
choice.className = "badValue"; // change colour of incorrect choice.
else
// Clear class to use default rendering.
choice.className="";
}
</SCRIPT>