Quick Populate Buttons jquery/java
-
Good day I hope you can help me
I’m creating a custom plugin and I would like to add 3 Buttons to change the value in a textbox field.
These 3 buttons has values attached to them but it need to do a calculation by adding their value to a existing value/variable and then fill the field with the result
I have written a JavaScript that works but because the form name and textbox name has dashes in them I cant get it to work, so I think I need a jQuery script instead, but I have no idea how to make it work. Any help will be appreciatedHere is an example f code I have written that works on in its own not in my plugin, just to give you an idea what I want to accomplish:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "https://www.w3.org/TR/html4/strict.dtd"> <html lang="en-GB"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Button Form Populate</title> <script type="text/javascript"> function transferField(someval) { document.groovyform.simba.value = someval; } </script> </head> <body> <form name="groovyform"> <input type="text" id="simba" value=""> <input type="reset" value="Reset"> </form> <input type="button" onclick="transferField(this.value)" value="1000"> <input type="button" onclick="transferField(this.value)" value="500"> </body> </html>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Quick Populate Buttons jquery/java’ is closed to new replies.