Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JavaScript for Search button

Raj SinhaMar 3 2010 — edited Mar 4 2010
Hi Everybody,

I am trying to use a JavaScript function to check if entered value is numeric or not when user click 'Search' button in a page.

1. On header of the page I entered attached JavaScript function as follow
2. On HTML Form Element Attributes for item('P15_KEY_LOC') where I want to check entered value is onsubmit="IsNumerict('P15_KEY_LOC');"

But, not getting alert msg on clicking 'Search' button. Obviously JavaScript is not functioning.

Your comment or help would be appreciated.

Thanks,
Raj

--------------------------------------------------------------------------------------------------------------
<script language="JavaScript" type="text/javascript">

function IsNumeric(sText)
{
var ValidChars = "0123456789";
var IsNumber=true;
var Char;

for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;

}
function ValidateForm(numb)
{
if (!IsNumeric(num))
{
alert('Please enter only numbers in the key location field')
}

}
</script>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2010
Added on Mar 3 2010
3 comments
594 views