On the scope of radio buttons in HTML - html

Several radio buttons with the same name act as a set, where checking one unchecks the others.
What is the scope of this behavior?
The form in which the button resides
The page / document on which the button resides
Does scope pass into iframes?
I have always used them in forms, but now writing formless HTML (using ajax for posting), and everything seems to be working just fine, so my guess is #2.

Radio buttons with the same name in the same form act as a set, but not with those of different forms. Radio buttons with no form act as a set with those with no forms.
test it yourself:
http://jsfiddle.net/8qqNC/1/

Radio buttons are scoped to the form they are in.
Frames contain external documents, and nothing in them is considered part of the current document, let alone an element within that document.

Related

Jump to specific field when a multiple choice radio button is selected in Gravity Forms

is there an option or maybe a small custom code to make Gravity Forms radio buttons jump to a field on selection?
In my example, i have a list of 14 options. Using a condition logic when you select one option a custom HTML is revealed right under each and every option. For desktop is super ok, the screen is big and all fit well. The problem is for mobile devices because you select an option but after that, you have to scroll to see the custom HTML.
Is there any option or custom code snippet in Gravity Forms that jumps to that custom HTML when an option is selected?
I found some resources on how to make this using HTML code with ids but this is somehow dynamic though the HTML code is placed in the same position. My first idea was to add the same ID to each and every HTML code so that when a radio button is pressed it scrolls to that ID. Don't know if it makes sense but ...
Can someone help me with some resources or give me some hints? Many thanks.

How does HTML form know which select option is selected?

I am trying to understand how the HTML form standard works in relation to select boxes. And the question is how does HTML form know which value a select box has as selected value in order to submit it when the form is submitted. I am inspecting a form with developer tools and I do not see anything changed whenever I change the select box selected option.
This is a pure HTML question and it should be pretty basic for those that they know the HTML standard well. Note that I am not asking for a JavaScript answer on how to get the selected option. I am asking a question in order to understand how does HTML form know which of the options is selected.
If you also have pointers to any documentation, that would be much appreciated.
You could ask the same question about how does a form know a checkbox is checked, or what text has been typed into an input field. The HTML for a web page gets parsed into a DOM (Document Object Model), and there are objects behind the scenes representing DOM elements. These objects, among other things, save state information about DOM elements such as selected options and the checking of checkboxes.
Those states don't show up just by viewing the source of a webpage, or necessarily even when using an inspect tool. But the info is there in the DOM for the browser to assemble into the HTTP request that is generated when you submit a form.

What is a form control in HTML?

When researching how to write forms in HTML I see mention of the term "form control".
In particular using Twitter Bootstrap which has classes like form-control and control-label.
What exactly is a "form control"?
A form is a component of a Web page that has form controls, such as text fields, buttons, checkboxes, range controls, or color pickers. A user can interact with such a form, providing data that can then be sent to the server for further processing (e.g., returning the results of a search or calculation). No client-side scripting is needed in many cases, though an API is available so that scripts can augment the user experience or use forms for purposes other than submitting data to a server.
A form control is a user interface control that serves as the point of connection between the user and the server. Interactions vary by control type: buttons: button file handling: input type="file" menus: select, etc. And are also grouped into categories
Controls are essentially an API of key-value pairs for pinging back and forth to the server.
W3C's Form Section is incredibly informative in its walk through of forms, form elements, form controls, form owners, and more insight to the inner workings of the Internet's workhorse: the humble HTML form.
References:
Forms
HTMLFormElement
Association of Controls and Forms
XForms Glossary
Form Controls Infrastructure
For Bootstrap it seems to be a styling thing: From bootstrap's page:
Individual form controls automatically receive some global styling. All textual <input>, <textarea>, and <select> elements with .form-control are set to width: 100%; by default. Wrap labels and controls in .form-group for optimum spacing.
But more broadly it seems to be more, as per #the_velour_fog 's comment:
it seems to be more than just a styling thing: it seems form control just refers to the individual HTML elements in a HTML form e.g. from https://html.spec.whatwg.org/multipage/forms.html; A form is a component of a Web page that has form controls, such as text fields, buttons, checkboxes, range controls, or colour pickers.
The term has very little to do with styling, though styling forms is a special art.
'Form elements' are the (usually interactive) controls whose values are submitted automatically with the http request that is initiated by clicking the "submit" button - even without javaScript. Most commonly this would be button, input, textarea and similar element types. MDN has this entry with hyperlinks to documentation of each type.
Anything where a value attribute is meaningful or expected can be a form element. The name attribute is also important, since this is used (e.g. on the server side) as a 'key' for the value in the form data.
The supporting elements such as label, fieldset and legend are commonly regarded as form elements, since they exist to name and group the other form elements from the user's point of view, although they contribute nothing to the submitted form data.
There may be elements in the form which have no 'value' attribute (e.g. headings, hyperlinks or images), but strictly speaking, these are not 'form elements'. They may however contribute to the form data via client-side javaScript.
And you can use form elements in something which is not a form, or which makes parameterised http requests without an explicit form element. This is very common.

Does submit button apply to only form its in or all forms on page?

I am planning on setting up multiple forms on a page and wanted to make sure that this is ok. Do submit buttons act only on the form they are inside of or do they apply to all the forms on a page?
A submit button submits a form. It seems that the specifications do not clearly say that this means the enclosing form element, probably because this was taken as self-evident. And it’s certainly what browsers do.
HTML5 drafts make this a bit clearer by introducing the concept of “form owner” of a field (such as a submit button). By default, the form owner is the enclosing form element, though the proposed form attribute of a field could change this. And a submit button is defined as submitting the form owner.
As far as I know (and I'm pretty sure), submit buttons/inputs will by default only act on it's parent form. You can read more about forms in the W3 specifications.
So if you just wonder if it's ok to have multiple forms in your page, then yes, it is.

Oracle Forms : How to make a window/canvas/form the starting one

I have a school project where I have to make a small database application using Oracle Forms.
I have 4 forms in my application:
A login form
A main form
A form that is displayed after the new button is pressed on the main form
Another form that is displayed after the edit button is pressed on the main form.
I've created the forms in the mentioned way.
When I start the application, I want the login form to be the starting form. Now what starts first is the edit form (the last one created).
How can I manage that?
Thank you.
The form loads that canvas first which holds the first data block in the Object Navigator. So make sure that your login form block is first on the list.
You can also set the "First Navigation Data Block" in the Property Palette for the form to the desired block on the login form and it will display that first, overriding the first block in the other answer.