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()"/> Link to comment https://forums.phpfreaks.com/topic/88729-solved-onclick-help/ 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 Link to comment https://forums.phpfreaks.com/topic/88729-solved-onclick-help/#findComment-457532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.