I want to change a textbox name before form submit
My text box:
<input type="text" name="txtUserName" id="txtUserName" />
I make this function for java script:
function abc()
{
document.getElementById('txtUserName').name="ID_USERNAME"
document.loginform.action = "url";
}
I tried document.getElementById('txtUserName').name="ID_USERNAME" but not working
Note: Please Do not use JQuery Function
Your code works fine. (I filled in a few bits):
See it running here : http://jsfiddle.net/giddygeek/XvtnZ/2/ Run it and inspect the element (in Chrome) or view the source, and check your textbox element.
JS: