• 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
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

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: 67558
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: 67558
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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic