weirdwes
03-11-2004, 11:34 PM
I am working on a page that has it's value read in through a database. One of the form's hidden fields is name "productName". In this field a value is imported from the database. I know this portion works becase I've use it on countless other pages and I display this field in another area of the page and the names are all read correctly.
I am trying to test against the value of this field and execute a section of code if it's true. Here is what I have.
var sel = document.toppings;
alert (sel.prodcutName.value);
If (sel.productName.value = "Calzone')
{
alert (" I am executing");
//do this stuff
}
Now if the first alerts shows "Calzone" then the second alert should show. The 2nd alert shows every single time regardless of what the first alert shows. This leads me to believe my if statement is not checking the value correctly and it probably has something to do with the quotes. I've tried using double " " on each side, but dreamweaver always replaces the 2nd " with '.
Help? :)
I am trying to test against the value of this field and execute a section of code if it's true. Here is what I have.
var sel = document.toppings;
alert (sel.prodcutName.value);
If (sel.productName.value = "Calzone')
{
alert (" I am executing");
//do this stuff
}
Now if the first alerts shows "Calzone" then the second alert should show. The 2nd alert shows every single time regardless of what the first alert shows. This leads me to believe my if statement is not checking the value correctly and it probably has something to do with the quotes. I've tried using double " " on each side, but dreamweaver always replaces the 2nd " with '.
Help? :)