Connecting Tech Pros Worldwide Help | Site Map

Random Number Generator Pop Up Error

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 27th, 2008, 04:18 PM
Newbie
 
Join Date: Aug 2008
Posts: 1
Default Random Number Generator Pop Up Error

Hi,

I have a html form on a web page that I am using a hidden field that has a random number inserted by javascript.

[HTML]
<script>
function genRandomNumber() {
document.form.hidden.value = Math.floor(Math.random()*100);
alert(document.form.hidden.value);
}
</script>[/HTML]
I call this script with onload="MM_callJS('window.onload = genRandomNumber();

It works fine and the random number is inserted in the hidden field...but when the page loads a IE pop up error box shows up with the random number and on OK box.

Is there a way to keep this error box from showing up? I am using IE 7.

Thanks for any input

Last edited by gits; August 27th, 2008 at 07:42 PM. Reason: added code tags
Reply
  #2  
Old August 28th, 2008, 09:53 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,257
Default

What does the error message say? Does it only occur in IE or on other browsers too?
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.