PHP - Moved: Onclick Display Insert Form
Amazingly, PHP Coding Help != JavaScript Help.
This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333336.0 Similar TutorialsHello, What I am looking to do is have a series of buttons laid out and when the user 'onClick', a table from my MySQL database will load into a scrollable textbox within the same webpage. I figure I need to go about this using AJAX, which unfortunately I have basically no experience in. For example purposes here is what I have going: This php code basically just displays the table we want to tie the button click to. Code: [Select] <?php include("connect.php"); //Query of facebook database $facebook = mysql_query("SELECT * FROM facebook") or die(mysql_error()); //Output results if(!$facebook) { echo "There was an error running the query: " . mysql_error(); } elseif(!mysql_num_rows($facebook)) { echo "No results returned"; } else { $header = false; echo "<table border='1'>\n"; while($row = mysql_fetch_assoc($facebook)) { if(!$header) { echo "<tr>\n"; foreach($row as $header => $value) { echo "<th>{$header}</th>\n"; } echo "</tr>\n"; } echo "<tr>\n"; foreach($row as $value) { echo "<th>{$value}</th>\n"; } echo "</tr>\n"; } echo "</table>\n"; } mysql_close(); ?> I'd really like to make this as easy as possible. After doing research, I figured that just Javascript would not be enough because it is client-side. It would be great if someone could point me in the right direction. Thanks in advance to anyone who replies. This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=308673.0 Amazingly, PHP Coding Help is not the place to ask JavaScript questions. Mind blown. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=332796.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=358574.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=309473.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333337.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=308937.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=350408.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=315743.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=359130.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=344267.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=354933.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=319161.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=352154.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=308768.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=315503.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=346503.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=342913.0 Hello, When a user clicks a Submit button on my page, I'm using an onClick event to essentially just disable the button and change the message to 'Saving'. However, when I add the onClick code, the form no longer posts using PHP. The button does indeed change but the postback never occurs. Is there something extra I need to add or do? Thank you!! This is my submit button: Code: [Select] <input type="submit" id="submit" value="Save Changes" onclick="this.disabled=true; this.value='Saving'">|<a href="/">Cancel</a> Then I have the normal PHP stuff for postback which isn't firing.... Code: [Select] //IF POSTBACK if ($_SERVER['REQUEST_METHOD'] == 'POST') { //DO STUFF HERE } |