ballhogjoni Posted January 31, 2008 Share Posted January 31, 2008 Can someone tell why this script isn't working? When I click the button it doesn't do anything. <script type="text/javascript"> function enableDisable() { edit = 'yes'; } edit = "no"; if (edit = "no") { document.write("<input name=\"BuyerEmail\" type=\"text\" id=\"email\" size=\"20\" disabled=\"disabled\" value=\"<?php echo $_POST['buyer_email']; ?>\"><input type=\"hidden\" name=\"e_BuyerEmail\" value=\"Please enter your email address\">"); } else { document.write("<input name=\"BuyerEmail\" type=\"text\" id=\"email\" size=\"20\" value=\"<?php echo $_POST['buyer_email']; ?>\"><input type=\"hidden\" name=\"e_BuyerEmail\" value=\"Please enter your email address\">"); } </script> <input type="button" name="editEmail" value="Edit Email" onclick="enableDisable()"/> Quote Link to comment Share on other sites More sharing options...
jaymc Posted February 4, 2008 Share Posted February 4, 2008 Change if (edit = "no") { to if (edit == "no") { == when comparing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.