I am working for a customer who shows a value on a form within their text box The form is needed, though the systems are unable to do this because of how they are coded.
What would be the best way to do this because I am unable to edit the source code of the form creation module to generate values when a user creates a form then it should be set automatically.
I know that there are ways with javascript that can be done, but mostly I have found that editing the input boxes or styling / attributes on the form which I do not have.
But I have a pre-existing style on this area of this code, as well as a cover around the form, it can target specific areas with the style or script.
HTML example:
Lt; Form name = "foobar" & gt; & Lt; Input name = "my_name_1" /> & Lt; Input name = "my_name_2" /> & Lt; Input name = "my_name_3" /> & Lt; / Form & gt; Javascript: function putNamesAsValues (formname) {var elements = document.forces [formname] .elements; (Var i = 0; i & lt; elements.length; i ++) if (element [i] .tagName.toLowerCase (). IndexOf ('input')! = -1) element [i] .value = Elements [i] .name; } PutNamesAsValues ('foobar');
Usage:
Form name
is the parameter putNamesAsValues ('foobar');
No comments:
Post a Comment