Get data from subform to main form
I have a structure like :
<form id="first_form">
<fieldset>something</fieldset>
<fieldset>
<iframe><html> ...
<form id="second_form">
<input type="hidden" value="**some_value**" name="hidden_data" />
</form>
</html></ifram开发者_JAVA百科e>
</fieldset>
</form>
What i need from this structure is to take the value from "hidden_data" in main form, and then to go post in database. I tried to prin_t($_POST); die; (after submitting first form) but i don't receive any input from second_form. Does somebody have an idea? Regards
Note : It's about wordpress plugin tdo mini forms
Note 2 : I want to get an url from an uploaded file (url which i get after i submit second_form) and then add as post meta, using first_form.You can't just dump HTML inside of an iframe
element. Any children of iframe
are simply there to be displayed if the browser can't handle iframe
s.
Also, nested form
elements doesn't validate (in HTML 4.01 Strict anyway, and I doubt in any others).
Why are you using an iframe with a form in it? Seems strange. And having HTML inside of that isn't what it is <iframe>
tag is used for. Would be best to just have 1 form id="first_form"
with the hidden element from the form id="second_form"
in it. You can't put a form inside of another form, there can only be one at any given time.
精彩评论