Take the 2-minute tour ×

I have a form with a set of inputs, and I want my page to refresh when one of them changes. I have a second set of inputs on the OTHER side of the page, and the css layout doesn't make it convenient for me to put them in the same <form> </form> tag. I was wondering if there is a way that I can make sure those "inputs" that are located outside the <form> tag are still associated with that form. Is there some way we can assign a "form id" to the inputs?

Any help would be much appreciated.


share|improve this question
You could manually grab their values using javascript on submit. What is stopping you from putting them into the form? Do you have formatting attached to the <form>? –  user122211 Jul 10 '11 at 22:28

1 Answer 1

up vote 21 down vote accepted

In HTML5, you can use the form attribute:

A form-associated element is, by default, associated with its ancestor form element, but may have a form attribute specified to override this.

If a form-associated element has a form attribute specified, then that attribute's value must be the ID of a form element in the element's owner Document.


<form id="myform">
    <input id="something" type="text">

<button form="myform" type="submit">Submit that form over there</button>

You should however make sure that it is clear to the user that these visually separated form elements are in fact connected.

share|improve this answer

Your Answer


