Javascript not working for Firefox [message #488795] |
Tue, 11 January 2011 03:37 |
BBMamun
Messages: 94 Registered: February 2010 Location: Dhaka, Bangladesh
|
Member |
|
|
Hi I have a simple text item validation function which works for MSIE, Google Chrome and Opera But it does not work for Mozilla Firefox.
My javascript function is as below:
function NumericValidation(pThis){
if (isNaN($v(pThis))){
alert('Value is not a valid number');
}
else if ($v(pThis)<=0){
alert('Must be a positive value!');
}
else {
1=1;
}
}
Any Idea..Please notify
Regards
Hasan Al Mamun
Programmer
Bangladesh Bank
Dhaka, Bangladesh
|
|
|
|
|
|
Re: Javascript not working for Firefox [message #488812 is a reply to message #488806] |
Tue, 11 January 2011 05:02 |
BBMamun
Messages: 94 Registered: February 2010 Location: Dhaka, Bangladesh
|
Member |
|
|
I have mentioned Apex 3.2 in the tag below the topic name. Since I have posted it in the Apex forum and Oracle Apex deals with javascripts so I think topic is relevant. Yes javascript may have it's own forum, may be I should ask the question there as well, but I am talking about using javascript in Oracle Apex 3.2 using different web browsers. I need responses from people who work in Apex and faced the problem and solved it. That's why I posted the topic here.
Regards
Hasan Al Mamun
|
|
|
|
Re: Javascript not working for Firefox [message #488821 is a reply to message #488817] |
Tue, 11 January 2011 05:30 |
BBMamun
Messages: 94 Registered: February 2010 Location: Dhaka, Bangladesh
|
Member |
|
|
Hi, $v(pThis) is an Apex defined function. it will not work anywhere else same as it works here in apex. So Apex people can answer me here. I am hopeful for help in Apex forum.
Regards.
Hasan Al Mamun
|
|
|
|
Re: Javascript not working for Firefox [message #488876 is a reply to message #488838] |
Tue, 11 January 2011 22:56 |
BBMamun
Messages: 94 Registered: February 2010 Location: Dhaka, Bangladesh
|
Member |
|
|
Hi c_stenersen, thanks for your advice, I have re-written the function like this
function NumericValidation(pThis){
if (isNaN(document.getElementById(pThis).value )){
alert('Value is not a valid number');
}
else if (document.getElementById(pThis).value <=0){
alert('Must be a positive value!');
}
else {
var a = 1; //actually does nothing. it's a fake assignment.
}
}
Now it also works for Firefox. Thank you.
Regards
Hasan Al Mamun
[Updated on: Tue, 11 January 2011 22:56] Report message to a moderator
|
|
|
|
|