question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get Form data other than form elements ?

See original GitHub issue

Be able to render a formeo form by calling:

var formeo = new Formeo(formeoOpts, JSON.stringify(formJSONData));

and get formeo FormData by calling:

formeo.formData()

However, this FormData json contains ONLY form elements data, without input data in it .

Is there possible to get this ?

FormData json data like this:

var formJSONData = {
    "id": "51100a54-1370-494a-8ad6-9d934c593623",
    "settings": {},
    "stages": {
        "6ded269e-27f5-441b-835f-8bb8751ba0e8": {
            "id": "6ded269e-27f5-441b-835f-8bb8751ba0e8",
            "settings": {},
            "rows": [
				"aae2d953-e7ec-44bf-ad0b-a5fbce738372"
            ]
        }
    },
    "rows": {
        "aae2d953-e7ec-44bf-ad0b-a5fbce738372": {
            "columns": [
				"3d4c10e2-5255-4051-8c8b-53bd048e2787",
				"3fe2f05c-754b-4cc7-8443-a67cc2e8fbc6"
            ],
            "id": "aae2d953-e7ec-44bf-ad0b-a5fbce738372",
            "config": {
                "fieldset": false,
                "legend": "",
                "inputGroup": false
            },
            "attrs": {
                "className": "f-row"
            }
        }
    },
    "columns": {
        "3d4c10e2-5255-4051-8c8b-53bd048e2787": {
            "fields": [
				"txtUserName"
            ],
            "id": "3d4c10e2-5255-4051-8c8b-53bd048e2787",
            "config": {
                "width": "50%"
            },
            "style": "width: 50%",
            "tag": "div",
            "content": [
				{
				    "tag": "input",
				    "attrs": {
				        "type": "text",
				        "className": "form-control"
				    },
				    "config": {
				        "label": "Santosh"
				    },
				    "meta": {
				        "group": "common",
				        "icon": "text-input"
				    },
				    "fMap": "attrs.value",
				    "id": "txtUserName"
				}
            ],
            "attrs": {
                "className": [
					"f-render-column"
                ]
            }
        },
        "3fe2f05c-754b-4cc7-8443-a67cc2e8fbc6": {
            "fields": [
				"b811d59b-5191-4de7-baab-52d931317a09"
            ],
            "id": "3fe2f05c-754b-4cc7-8443-a67cc2e8fbc6",
            "config": {
                "width": "50%"
            },
            "style": "width: 50%",
            "tag": "div",
            "content": [
				{
				    "tag": "select",
				    "config": {
				        "label": "Project"
				    },
				    "attrs": {
				        "className": "form-control"
				    },
				    "meta": {
				        "group": "common",
				        "icon": "select",
				        "id": "select"
				    },
				    "options": [
						{
						    "label": "select",
						    "value": "select",
						    "selected": true
						},
						{
						    "label": "Option 2",
						    "value": "option-2",
						    "selected": false
						}
				    ],
				    "id": "b811d59b-5191-4de7-baab-52d931317a09"
				}
            ],
            "attrs": {
                "className": [
					"f-render-column"
                ]
            }
        }
    },
    "fields": {
        "txtUserName": {
            "tag": "input",
            "attrs": {
                "type": "text",
                "className": "form-control"
            },
            "config": {
                "label": "Santosh"
            },
            "meta": {
                "group": "common",
                "icon": "text-input"
            },
            "fMap": "attrs.value",
            "id": "txtUserName"
        },
        "616c0063-e856-4dbe-8343-916bbf54f9e5": {
            "tag": "input",
            "attrs": {
                "type": "text",
                "className": "form-control",
                "id": "Santoshk1"
            },
            "config": {
                "label": "Santosh"
            },
            "meta": {
                "group": "common",
                "icon": "text-input"
            },
            "fMap": "attrs.value",
            "id": "Santoshk1"
        },
        "b811d59b-5191-4de7-baab-52d931317a09": {
            "tag": "select",
            "config": {
                "label": "Project"
            },
            "attrs": {
                "className": "form-control"
            },
            "meta": {
                "group": "common",
                "icon": "select",
                "id": "select"
            },
            "options": [
				{
				    "label": "select",
				    "value": "select",
				    "selected": true
				},
				{
				    "label": "Option 2",
				    "value": "option-2",
				    "selected": false
				}
            ],
            "id": "b811d59b-5191-4de7-baab-52d931317a09"
        }
    }
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
kevinchappellcommented, May 1, 2018

I see what you mean @jerry1167 . Would it be helpful to add a new method that returns only user submitted formData and have formData() return the full formData object?

Also what should user submitted data method be called? userData, submittedData?

0reactions
jcmechamcommented, Aug 2, 2021

@kevinchappell I was wondering whether this feature has been implemented? I would love to use it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sending form data - Learn web development | MDN
The <form> element defines how the data will be sent. ... of different methods, the most common being the GET method and the...
Read more >
How can I get form data with JavaScript/jQuery? - Stack Overflow
The solution for POST method is the same, just use $('form'). serialize(). Also the POST method does not have limit of 2000 characters...
Read more >
Use forms to get data from users - web.dev
Use forms to get data from users. Learn the basics of using a form on the web with this introduction to the form...
Read more >
FormData - The Modern JavaScript Tutorial
FormData objects are used to capture HTML form and submit it using fetch or another network method. We can either create new FormData(form) ......
Read more >
Chapter 18 Forms and Form Fields - Eloquent JavaScript
Fields created by <input> tags with a type of text or password , as well as textarea tags, share a common interface. Their...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found