Reputation: 37
I have a form which sends post data to a PHP parser, but I'm asking the user to input A LOT of data, so I went for jQuery UI modal dialogs to simplify the input.
So user enters values for fields - Name, Company, etc. and opens a dialog where he can pick machines, parts, etc. Sample code below.
<form method="post">
<input name="first_name" type="text">
<input name="last_name" type="text">
<div id="modal">
...
some more inputs here
...
</div>
</form>
The thing is, that the inputs which are in the modal dialog are not posted to PHP. Normally the modal window is hidden via CSS and it's hidden on posting the form so I suppose this is the issue.
Has anyone faced the same or similar problem?
Any hot fix for it?
I got to mention that hard-coding javascript to set the inputs' values in the modal out of it is not an option because we have like 30 different modals with over 10 input fields in it.
Upvotes: 0
Views: 137
Reputation: 5572
Try the HTML5 input element's form attribute for the elements defined in your modal.
http://www.w3schools.com/htmL/html_form_attributes.asp
Upvotes: 1