johng Posted February 16, 2007 Share Posted February 16, 2007 I am quite a newbie to php, so in addition to not knowing how to do this, I also am kind of stuck on how to go about looking for the answers. I am working on a page where people will enter data and it will go into a database. I would like it to have some dynamic displays to it, in particular, I would like it to total some numbers entered into text boxes and display the total when the user tabs out or clicks outside of the text box. Essentially it would calculate and display the sum of the numbers entered by the user. I have searched for something that will do this (like onblur), but I haven't really found anything with examples that I could use. The only thing that I have found is code to clear the input fields, and when I tried to retrofit it for my purposes, it either spit out an error, or it just wouldn't do anything. I'm not even sure if this is possible with php, but I think I could also possibly use javascript (maybe?). Any help with this problem would be much appreciated, even just a point in the right direction. Another question I had was what is a good book for php? Currently I have the "PHP Black Book," but I'm not sure about it yet. (In addition, a JavaScript book would probably also be good to have) Thank you in advance. -John Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 16, 2007 Share Posted February 16, 2007 What you're trying to do is javascript. Check out mootools.net Quote Link to comment Share on other sites More sharing options...
johng Posted February 16, 2007 Author Share Posted February 16, 2007 Thank you very much for the quick response! Quote Link to comment Share on other sites More sharing options...
clarke78 Posted February 16, 2007 Share Posted February 16, 2007 you could always just use a submit button and have the page refresh with the answer... but yes javascript would be the best for wanting to have the answer calculate once you click out of the box. Quote Link to comment 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.