D
DrKen
I'm having trouble with Alert() not working. I have created a web
page that I am only running locally in Firefox just to verify that I
have coded my JavaScript properly. I am using onsubmit in the Form
tag and I have one JS function. I put an Alert into it to be sure
that the code was doing the right thing but I don't ever see an Alert
box. I thought that Alert() was modal, so it should show up and
nothing should be doable on the web page until I've responded to the
Alert. However, when I click the submit button I get nothing.
Here is my fairly simple JavaScript:
<script type="text/javascript" src="https://www..../jquery-1.2.6.js">
function createCookie(name,days)
{
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else
var expires = "";
var value = document..getElementById('USERID');
var idMessage = "The user id is: " + value;
alert(idMessage);
document.cookie = name+"="+value+expires+"; path=/";
return false;
}
</script>
Here is the Form tag:
<form name="FORM" action="" method="POST" onsubmit='return
createCookie("crmCookie", 1)'>
I know this form, before I added the JavaScript, worked fine, as it
runs in production and is used regularly. What am I missing? Thanks.
Ken
page that I am only running locally in Firefox just to verify that I
have coded my JavaScript properly. I am using onsubmit in the Form
tag and I have one JS function. I put an Alert into it to be sure
that the code was doing the right thing but I don't ever see an Alert
box. I thought that Alert() was modal, so it should show up and
nothing should be doable on the web page until I've responded to the
Alert. However, when I click the submit button I get nothing.
Here is my fairly simple JavaScript:
<script type="text/javascript" src="https://www..../jquery-1.2.6.js">
function createCookie(name,days)
{
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else
var expires = "";
var value = document..getElementById('USERID');
var idMessage = "The user id is: " + value;
alert(idMessage);
document.cookie = name+"="+value+expires+"; path=/";
return false;
}
</script>
Here is the Form tag:
<form name="FORM" action="" method="POST" onsubmit='return
createCookie("crmCookie", 1)'>
I know this form, before I added the JavaScript, worked fine, as it
runs in production and is used regularly. What am I missing? Thanks.
Ken