javascript - Fetching input box value on submit button click -
I am working on a game using the ImpactJS
engine and I A basic form has been created, which includes the input box and the submit button I am able to get the value from the input box, but I want to get the click when the player submits to whatever they believe in the input box Able to get that value on No need. If the value is zero then I should get a warning "no value or whatever" I want to use this final value and want to allocate it to a variable, to keep track of input from within the game I can use my javascript files inside the impact engine. I am new to HTML, CSS in general, so I do not know how to achieve it.
Below is my HTML / CSS code that has an input box and a submit button
To display the input box and submit the button using Jquery, enter the ImpactJS
code in my block code
Problem performance: Work () {this.SsetQuestion ('This is a title', 'This is where the body will go and it will be long and impossible to understand for reading.', 'This is an indication'); This.isActive = True; Var form = $ ("# problem format"); Var input box = $ ("# prompt"); Var submitButton = $ ("# problemsubmit"); Form.show (); InputBox.show (); SubmitButton.show (); },
This is what I have worked for now. But now I want the string in the input box to be stored in a different variable when click on the submit button. How to get it?
Thank you!
Try it with.: / P>
html:
< Pre> & lt; Input id = "probleminput" class = "form-inline" type = "text" style = "display: inline;" & Gt; & Lt; / Input & gt; & Lt; Button ID = "Problems" class = "BTN" style = "display: inline-block;" & Gt; Submit & lt; / Button & gt; & Lt; An id = 'testop' & gt; & Lt; / A & gt;
JS:
var form = $ ("# problemform"); Var input box = $ ("# prompt"); Var submitButton = $ ("# problemsubmit"); Val (): $ ("# probleminput"): val (): Warning ('Please fill in the text field')) $ ('#testop'). Text (getval);});
Comments
Post a Comment