This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text field input not sent with other form data

 
Mark Peterson
Greenhorn
Posts: 5
Android Chrome Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this survey, all code works great except when the submit button is clicked. The form returns all data except the data in text input fields - notEmpty, notEmpty2, and emailVal. Any help to get the text input field data to be sent also would be greatly appreciated.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Peterson wrote: the data in text input fields - notEmpty, notEmpty2, and emailVal.

I'm confused. Those aren't text fields, they are JavaScript functions.
 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The onsubmit action is something that happens entirely in the browser, the return value is either true (which means 'go ahead and submit the form') or false (which means 'do not submit'). If you want the server to see values, then those values have to be in fields in the form.
 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also remember that the input fields in your form must have a "name" attribute. That's what the GET/POST will submit. It doesn't care about the field id, although you can make the name the same as the id if you wish.
 
Mark Peterson
Greenhorn
Posts: 5
Android Chrome Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reminding me, J. Kevin, that fixed the problem!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Kevin Robbins wrote:although you can make the name the same as the id if you wish.


Although be careful with conflating name and id. names do not need to be unique, but ids do!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic