Skip to content Skip to sidebar Skip to footer

One Input Field, Multiple Names

In a HTML form, how can I get two names from one input field? Is it possible through hidden input fields? And how? I tried to make the hidden field value dynamically equal to the n

Solution 1:

It is not possible without JavaScript. Hidden input fields are just static data, as far as HTML is concerned; they are not affected by user input in any way. Similarly, when user input changes the value of a field, there is no way in HTML to specify that this would also change another field.

The statement “I’d like to use both attributes for different websites, which use different names for the same property” seems to suggest that the form data is to be submitted to one of two or more servers depending on something. Although this is technically possible without JavaScript if certain HTML5 features are used, their browser support is limited. The feasible options are: 1) Use different forms, 2) Use JavaScript, 3) Use a simple server-side mediator that passes the data forward to one or more server-side handlers depending on some field(s) in the data.

Post a Comment for "One Input Field, Multiple Names"