I was working on a search hack and needed the session state from ASP .Net controls and the ids from html controls using this hack: http://www.tqcblog.com/archive/2007/10/26/creating-a-custom-advanced-search-box-in-moss-2007.aspx. So I came up with a creative solution. I would add the html controls in the background. Here is some code if you would like to add your own hidden html controls or just create some for fun:
var currentElement = document.createElement("input");
currentElement.setAttribute("type", "hidden");
currentElement.setAttribute("name", "YourName");
currentElement.setAttribute("id", "YourID");
currentElement.setAttribute("value", "YourValue");
document.getElementById("DivName").appendChild(currentElement);
You are going to want to create a div or a span to add your elements or you can do
document.body.appendChild. SharePoint for some reason did not like that statement, so I created a div before the button to add the elements. You do not need to add a hidden element. You can add a checkbox, but remember to add an
element.display = "none"; or it will display the item. If you have any comments or questions send them my way. Hope you all have a good week!