By iamzoltanvaradi on
Hi!
I'm pretty new to Drupal, but i have a task to finish using D7. I've created a custom content type and added some integer fields to it. What i'd like to do is on the node page add a plus and a minus button and whenever one of the button's pressed, add to or take away from the value of the mentioned integer field.
How can i do that?
Thanks is advance!
Z
Comments
do you want to add that
do you want to add that button to the frontpage of the node or the backend (where you insert or update a node)?
front page
front page
You can use hook_node_view
You can use
hook_node_view something like this:
The code above is an example and isn't save for public use. The get values aren't checked if they are legit and can be manipulated.
But youmight get the idea. What you probally want to work towards is using ajax to make an call to a function in the background and update that integer.
The above should do the trick aswell, however the page will need to reload.