Ten Years of Service
Posts: 26
Threads: 4
Points: 25NSP
RE: Help with Updating database from PHP? 07-28-2016, 12:47 PM
#22
I added it after body tags and tried it but the page still refreshes and goes to blank page with the results
“I am thankful for all of those who said NO to me. It’s because of them I’m doing it myself.” – Albert Einstein
•
Ten Years of Service
Posts: 26
Threads: 4
Points: 25NSP
RE: Help with Updating database from PHP? 07-28-2016, 01:33 PM
#24
It's working but still goes to blank page with results after it shows pop-up
“I am thankful for all of those who said NO to me. It’s because of them I’m doing it myself.” – Albert Einstein
•
Ten Years of Service
Posts: 26
Threads: 4
Points: 25NSP
RE: Help with Updating database from PHP? 07-28-2016, 05:30 PM
#26
(07-28-2016, 01:36 PM)Ex094 Wrote: Typo detected
OMG I hate these mistakes
Replace this line in the Jquery code
Code:
e.preventdefault(); //Doesn't allow page to refresh
with this
The d was to be uppercase D, Yikes
Thanks Bud, You have taught me a lot since I am new to PHP that helps more then you think. Is there a way to style the pop-up window? Or is that the only way it will show up?
“I am thankful for all of those who said NO to me. It’s because of them I’m doing it myself.” – Albert Einstein
•
Ten Years of Service
Posts: 26
Threads: 4
Points: 25NSP
RE: Help with Updating database from PHP? 07-29-2016, 06:04 AM
#28
(07-28-2016, 05:56 PM)Ex094 Wrote: (07-28-2016, 05:30 PM)mudrig Wrote: Thanks Bud, You have taught me a lot since I am new to PHP that helps more then you think. Is there a way to style the pop-up window? Or is that the only way it will show up?
That alert is Javascripts default prompt but you can make a custom popup using Jquery, HTML and CSS. Lemme show you a simple way to displaying that response on the HTML document via DOM (In simple words, It allows you to easily manipulate HTML components)
In your body tag, paste this any where:
Code:
<div id="response"></div>
Now edit the following line in your Jquery
By
Code:
$('#response').html("<b>" + result + "</b>")
Now your response from the PHP Script will be displayed on the HTML document inside the div tags, You won't see a popup. Now use CSS and more Jquery to give that div some eye candy factor.
There are plugins available for this task in case you wanna get some ideas:
http://dinbror.dk/bpopup/
You have helped me once again thanks. If I run into anymore questions I cant figure out do you mind if I PM you on here?
“I am thankful for all of those who said NO to me. It’s because of them I’m doing it myself.” – Albert Einstein
•
Ten Years of Service
Posts: 26
Threads: 4
Points: 25NSP
RE: Help with Updating database from PHP? 07-29-2016, 06:18 AM
#30
I've got the form and the result working just the way I want it now and styled just right now
“I am thankful for all of those who said NO to me. It’s because of them I’m doing it myself.” – Albert Einstein