GreekGeek Posted August 20, 2011 Posted August 20, 2011 (edited) I would like to understand why when I execute: #include <IE.au3> $oIE_form = _IE_Example ("form") $MyObject = _IEGetObjByName ($oIE_form, "textExample") $MyText = $MyObject.innerText MsgBox(0, "", $MyText) and this is "textExample": <td><input type='text' name='textExample' value='http://' size='20' maxlength='30'></td> I do not obtain the "http://". But!! When I execute: #include <IE.au3> $oIE_form = _IE_Example ("form") $MyObject = _IEGetObjByName ($oIE_form, "textareaExample") $MyText = $MyObject.innerText MsgBox(0, "", $MyText) and this is "textareaExample": <td><textarea name='textareaExample' rows='5' cols='15'>Hello!</textarea></td> I do obtain "Hello". What seems inconsistent to me is that if I store a string in $MyText ($MyText.innerText = "Howdy") in both examples above it does work ?! Thanks Edited August 20, 2011 by GreekGeek
DaleHohm Posted August 20, 2011 Posted August 20, 2011 The string displayed in an INPUT TYPE=TEXT element is it's "value" property, not it's innerText. TextArea does use innerText (the text between the opening tag and the closing tag of the element. If you use the form element value property, you'll see that the DOM adds the consistency you are looking for. Using the IE.au3 function: $MyText = _IEFormElementGetValue($MyObject) Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
GreekGeek Posted August 23, 2011 Author Posted August 23, 2011 The string displayed in an INPUT TYPE=TEXT element is it's "value" property, not it's innerText. TextArea does use innerText (the text between the opening tag and the closing tag of the element.If you use the form element value property, you'll see that the DOM adds the consistency you are looking for. Using the IE.au3 function:$MyText = _IEFormElementGetValue($MyObject)DaleThanks for the help Dale.
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