nitation Posted August 25, 2008 Share Posted August 25, 2008 Can anyone help me out regarding this big one. I want a user to click on a link/button and beneath the link/button, an input box should display with a submit button. When the user click on submit, it should insert to mysql table. This I guess is Ajax and PHP/MYSQL. I am using AJAX because i don't want the page to reload. But i don't seem to get them right Thanks in Advance Quote Link to comment https://forums.phpfreaks.com/topic/121297-form-with-ajax-and-phpmysql/ Share on other sites More sharing options...
Ken2k7 Posted August 25, 2008 Share Posted August 25, 2008 What data is being inserted into the MySQL table? Without that information, the best I can do is this: <html> <head><title>blah</title></head> <body> <a href='javascript:void(0);' onclick='displaySubmit();'>Show Submit Button</a><br /> <input type='button' id='tehbutton' value='submit' onclick='doSubmit();' style='display:none;' /> <script> function displaySubmit() { document.getElementById("tehbutton").style.display = "block"; } function doSubmit() { var AJAX; try { AJAX = new XMLHttpRequest(); } catch (e) { try { AJAX = new XDomainRequest(); } // for the upcoming IE 8. catch (e) { try { AJAX = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { try { AJAX = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { AJAX = null; } } } } if (AJAX === null) alert("Your browser doesn't support AJAX"); else { AJAX.open("GET", "", true); AJAX.onreadystatechange = function() { if (AJAX.readyState == 4) { // do something } } AJAX.send(""); } } </script> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/121297-form-with-ajax-and-phpmysql/#findComment-625351 Share on other sites More sharing options...
DeanWhitehouse Posted August 25, 2008 Share Posted August 25, 2008 There is an ajax forum, please post in the correct place. Quote Link to comment https://forums.phpfreaks.com/topic/121297-form-with-ajax-and-phpmysql/#findComment-625452 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.