can someone see a reason this script would not work in FireFox:
[CODE]
function OnButton1() {
if (form.organization.value == “”) {
alert(“Please insert Organization.”);
form.organization.focus();
return false;
} else if (form.pos_title.value == “”) {
alert(“Please insert a Position Title.”);
form.pos_title.focus();
return false;
} else if (form.department.value == “”) {
alert(“Please insert a Department.”);
form.department.focus();
return false;
} else if (form.details.value == “”) {
alert(“Please fill Job Details.”);
form.details.focus();
return false;
}
var category = document.getElementsByName(‘category[]’);
var TotalLocationChecked = 0;
for (var i = 0; i < category.length; i++)
{
if (category[i].checked)
{
TotalLocationChecked = 1;
break;
}
}
if (TotalLocationChecked==0)
{
alert(“Please select at least one Category”);
category[0].focus();
return false;
} else {
document.form.action = “prev_post.php”
// document.form.target = “_blank”; // Open in a new window
// document.form.submit(); // Submit the page
}
}
the image calling it is:
<input type=”image” src=”images/preview.gif” border=”0″ name=button1 onClick=”return OnButton1();”>
it doesn’t ‘Alert’ if a field is empty and it doesn’t open the new page is the fields are ok. it DOES work if i remove all the fields verif. and just call the action…
thanks for your help, whomever… :o)