• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Text field input not sent with other form data

 
Greenhorn
Posts: 5
Android Chrome Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reminding me, J. Kevin, that fixed the problem!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
reply
    Bookmark Topic Watch Topic
  • New Topic