robert_gsfame Posted December 27, 2010 Share Posted December 27, 2010 i have a form <form name=frm1> <input type="checkbox" value="a" name="xxxx"> </form> i wish to get the name of the elements using document.frm1.elements to get the value, i simply use document.frm1.elements[1].value; when i try to use document.frm1.elements[1].name to get the name of the element, i cant get it Quote Link to comment https://forums.phpfreaks.com/topic/222734-get-form-elements-name/ Share on other sites More sharing options...
brianlange Posted December 27, 2010 Share Posted December 27, 2010 Your index is off. Use 0 instead of 1. document.frm1.elements[0].name Quote Link to comment https://forums.phpfreaks.com/topic/222734-get-form-elements-name/#findComment-1151847 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.