PHP - Moved: <select> And Onchange
This topic has been moved to JavaScript Help.
http://www.phpfreaks.com/forums/index.php?topic=305968.0 Similar TutorialsThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=320136.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333787.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=330989.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=323252.0 Hello, first time poster.. I've looked the web over for a long time and can't figure this one out. - Below is basic code that successfully checks MySQL for a match and displays result. I was debugging and forced the "height" and "width" to be 24 and 36 to make sure that wasn't the problem. That's good.. - I'd like to give the user ability to select width and height from a form.. and have it do an onchange this.form.submit so the form can be changing as fields are altered (thus the onchange interaction) - In a normal coding environment I've done this numerous times with no "Page cannot be displayed" problems. It would simply change one select-option value at a time til they get down the form and click submit... but in WordPress I'm having trouble making even ONE single onchange work! - I've implemented the plugins they offer which allows you to "copy+paste" your php code directly into their wysiwyg editor. That works with basic tests like my first bullet point above. - I've copied and pasted the wordpress url (including the little ?page_id=123) into the form "action" url... that didn't work... tried forcing it into an <option value=""> tag.. didn't work. I'm just not sure. I've obviously put xx's in place of private info.. Why does this form give me Page Cannot Be Displayed in WordPress every time? It won't do anything no matter how simple.. using onchange.. Code.. $con = mysql_connect("xxxx.xxxxxxx.com","xxxxxx","xxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxxxxx", $con); $myprodwidth=24; $myprodheight=36; $result = mysql_query("SELECT * FROM product_sizes WHERE prodwidth='$myprodwidth' and prodheight='$myprodheight'"); while($row = mysql_fetch_array($result)) { echo $row['prodprice']; } mysql_close($con); <form method="post" action=""> <select name="myheight" onchange="this.form.submit();"> <option selected="selected" value="">select height</option> <option value="xxxxxxxxx.com/wordpress/?page_id=199&height=36">36</option> <option value="xxxxxxxxx.com/wordpress/?page_id=199&height=36">48</option> </select> This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=320341.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=343149.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=348848.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=310935.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=350716.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=309828.0 This topic is now in MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=357554.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=357712.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=347920.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313023.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=359241.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=356136.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=348309.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=322930.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=312721.0 |