get value of text field on node.js
NickName:fujitsu4 Ask DateTime:2015-06-11T13:21:13

get value of text field on node.js

I want to write a simple program only with node.js (I don't want to use angular or another js Framework) which contains a text field.

Copyright Notice:Content Author:「fujitsu4」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30772170/get-value-of-text-field-on-node-js

Answers
Dave Pile 2015-06-11T05:49:28

Theres a few things wrong.\n\nBody Parser should be used like this\n\napp.use(bodyParser.urlencoded({extended: false}));\n\n\nYour form should specify the method\n\nmethod=\"post\"\n\n\nYour input element should use the name attribute as this is what gets passed to the server when the form is submitted\n\n <input type=\"text\" class=\"form-control\" id=\"inputphonenumber\" name=\"inputphonenumber\" \n\n\nput the closing form tag after the submit button\n\n<button type=\"submit\" class=\"btn btn-primary\">Submit</button></form>\n\n\nDont write your html code as one big var :)",


Matt L 2015-06-11T05:29:46

This isn't so much a Node question as it is a Javascript question, as the part you need help with is executed on the client side. Take a look at this question: jQuery get textarea text. It seems to be exactly what you're looking for. I just want to add - you really should learn something like Express and its res.render() function using templates. Writing HTML and Javascript in Javascript is not a good way to accomplish what you want.",


More about “get value of text field on node.js” related questions

get value of text field on node.js

I want to write a simple program only with node.js (I don't want to use angular or another js Framework) which contains a text field.

Show Detail

How to get text value of an element by using node.js?

I'm using node.js for UI automation with appium and I need to get a text value from elements. Did anyone do this before?

Show Detail

Get value into text field using combobox

I want to get value into text field from database when the value is selected from combo box p.s: the value in combo box and the value I want into text field come from same table in database

Show Detail

get value from text field in autoit

I want to get the value from a text field of a swing application in Autoit for comparing. Is there any tool for finding ID of specific field like firebug in browsers. And what is the code in Autoit...

Show Detail

Get Node.js to get user's input from a HTML text field?

I've basically been trying to make a simple game where the user can submit their high-score to a Node.js server. I'm just trying to do something very simple but can't seem to find much to help me o...

Show Detail

How get Node.JS fields value (submitted form data)

I use Node.js without framework (without-express). My current code. const { headers, method, url } = req; let body = []; req.on('error', (err) =&gt; { console.error(err); }).on('data', (

Show Detail

How to get the value of a disabled text field in jsp

I am having a dropdown box and a 5 textfields( all disabled). I am entering data into textfield by using javascript, from the dropdown(what ever value is present in the dropdown, goes into the text

Show Detail

Get the value of text field using jquery

I have this html code &lt;div class="sub-middle-column"&gt; &lt;div class="div-header"&gt;Grandsire &lt;a "#", class="table-control-focus sub-header-table-focus" id="t

Show Detail

Get Datatables cell value that is input text field

I'm generating a DataTable with a javascript data source. The data is returned from an ajax call to nodejs which queries SQL Server DB table and returns 2 columns, both numerical data. I'm adding 2...

Show Detail

get the input text field value on tooltip

Get the input text field value on tool-tip.for me I am using text-box with autocomplete..when ever i selected in autocomplete it will show in text-box. when i hover it i want tool-tip the value in ...

Show Detail