watagal Posted May 14, 2006 Share Posted May 14, 2006 GreetingsI want to pass the entire <input> object to the JS function to be able to access all of its properties. I can pass individual properties by specifying "this.(property)" as an argument (ie this.value, this.name, etc)my HTML code: <input name="txtTest" size="20" type="text" value="Test" onfocus="testTextbox(this)"> BTW, the above does not work.My JS code: function testTextbox(oTag){ alert(oTag.value); } But how do I pass the entire object?TIA Link to comment Share on other sites More sharing options...
scott100 Posted May 14, 2006 Share Posted May 14, 2006 I got it to work ok?? <head><script>function testTextbox(oTag){ alert(oTag.value); alert(oTag.size); alert(oTag.name);}</script></head><body><input name="txtTest" size="20" type="text" value="Test" onfocus="testTextbox(this)"></body> Link to comment Share on other sites More sharing options...
watagal Posted May 14, 2006 Author Share Posted May 14, 2006 I got it to work ok?? <{POST_SNAPBACK}> Thanks, it works now - I guess I was doing an [F5] refresh and it wasn't happening. I invoked a new IE window and it worked.Sorry for the false alarm, thanks again. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now