Get Value Of Hidden Input, Send To Another Hidden Input
I have a div that looks like this:
&l
Solution 1:
I think this (please note my comment) will help you.
To get the value of the hidden field:
var id = document.getElementById("product_id").value;
to implement it into another input...
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("value", id);
input.setAttribute("id", "FormInput528");
input.setAttribute("name", "FormInput528");
And then append your input to your form with:
document.getElementById("frmWishList").appendChild(input);
Solution 2:
If you're using JQuery:
var product_id_val = $("#product_id").val();
$("#FormInput528").val(product_id_val);
Solution 3:
Try:
var doc = document;
functionE(e){
return doc.getElementById(e);
}
functiongrabVal(name){
return"<input type='hidden' id='FormInput528' name='FormInput528' value='"+ doc.getElementsByName(name)[0].value+"' />";
}
E('frmWishList').innerHTML += grabVal('product_id');
Post a Comment for "Get Value Of Hidden Input, Send To Another Hidden Input"