CGWP

  • Home
  • Log in
  • « CEF nominal rolls
  • CEF forms: Attestation papers and War Diaries »

Inspect form data in javascript

Posted by gregster on 10 Apr 2017 in Activity log

Debugging a form got a bit easier with the FormData() method in javascript.

Insert function like:

function inspectFormData(formId){
	var formElement = document.getElementById(formId);
	var formData = new FormData(formElement);
	console.log('FIELDNAME: Value');
	for (var pair of formData.entries()) {
		console.log(pair[0]+ ': ' + pair[1]);
	}
}

And it’ll deliver this:

FIELDNAME: Value
METHENL: E
SURNAME: Adams
FORENAME: Charles Frederick
ADDRESS: 
MILSERACT: 
POB: Toronto, Ontario
NONOK: 
AONOK: 
RONOK: 
OCC[]: 
HISCO[]: 
DUGUID[]: UN
MARRIED: N
This entry was posted by Greg and filed under Activity log.

CGWP

Development blog for next version of the Canadian Great War Project. The production site is at https://cgwp.uvic.ca/, and the development site is at https://cgwpdev.uvic.ca/ (access controlled)

Some sections of the development site are not explicitly linked via menus. See the post titled "CGWP development URLs" for details.
  • Home
  • Recently
  • Archives
  • Categories
  • Latest comments

Search

Categories

  • All
  • Activity log
  • Discussion
  • Tasks

All blogs

  • Academic
  • AdaptiveDB
  • Admin
  • Announcements
  • CanMys
  • Cascade
  • CGWP
  • ColDesp
  • Depts
  • DVPP
  • Endings
  • HCMC Blogs
  • Landscapes
  • LEMDO
  • Linguistics
  • Maint
  • LondonMap
  • Mariage
  • MoM
  • Moses
  • Pro-D
  • Projects
  • ScanCan
  • HumsSites
  • Wendat

This collection ©2026 by admin • Help • framework