Home>
I want to get the contents of an input text with
when submitting a completely different form, enter it into a hidden field (a field invisible to the user), and send it.
If i google
document.forms. (id of referenced form). (id of referenced text box) .value
There are a lot of acquisitions like, but I didn't come out about writing, so I asked this question.
It can be a useful site, so please let me know.
Thank you.
<input type = "text" name = "namae" size = "40" maxlength = "20">
<% = form_with (model: @user_info, url: "/ xxx/yyy", local: true, html: {id: "comment_form", onklick: "send ()"}) do | f |%>
<% = f.hidden_field: txt_contents,: value =>''%>
<% = f.submit 'Send', id: 'xxx_btn'%>
<% end%>
<script>
function send () {
--- I want to put the contents of the above input into the hidden field ----
}
</script>
-
Answer # 1
Related articles
- javascript - i want to display the value of the input tag (text box) directly in the div tag as text
- javascript - assign the same value selected in the select box to the api variable and reload the graph
- i can't get the value of the input element of html in javascript
- javascript - i want to receive and display a value in a dialog box
- javascript - i want to use a function with the same name as a string that is the value of a variable in an object in vuejs
- javascript: i want to get the value of the selected option value
- i want to get the object of the value (property) only when the value of arrayfind exists in javascript
- countdown until the input value of the c language array becomes 1
- javascript - can you create a homepage using rails?
- javascript - i want to switch the display/non-display of password input with the eye icon
- javascript - i want to change the text depending on the boolean value in react
- php - i want to assign a value to a variable saved in mysql
- html css javascript i want to support two patterns of manual input and calendar input at the same time in the text box
- is it possible to get a value from an associative array by specifying an indefinite key in javascript?
- javascript - i want to assign a class to multiple objects
- ruby on rails 5 - how to check the value of before_action with debugger
- javascript - i want to get the value of ie currval in uwsc
- javascript - i don't understand why getelementsbyname isn't taking the value
- javascript - i want to create a new array by extracting the value from another array using the value of the array with index spe
- javascript - i want to get the value of a key that is common to multiple objects
Related questions
- javascript : Router is not React friendly
- javascript : Handling a click on a menu item
- javascript : Change the image on click and hide the first image
- javascript : Side menu display
- javascript : Multiple values in 1 ajax request
- javascript : Is the code adequate for the js test assignment?)
- javascript : Prop doesn't work on checkbox
- javascript : How to write the correct regex to wrap each character in a span except br and remove all spaces
- javascript : Open iframe link in new tab
- javascript : Stylized text selection
Is this not good?