VB2010 accessing with getelementbyID element <Textarea> strange behaivior

whambham

New member
Joined
Sep 26, 2012
Messages
2
Programming Experience
1-3
HI Im getting mixed results when trying to use VB to modify a web forms Textarea
if i save the webpage to my pc and access the webpage offline my code works
and i am able to inject data to the texarea

but if i test this code on the live server based webform it throws up an error "object ref not set to an instance"

the code im using is

webrowser1.documant.getelemantbyid("SET.Description").setattribute("Va
lue",textbox1.text)

using a webbrowser control a textbox and a button

i have a seprate button that will navigate to the webpage

the Textarea html source is

<textarea name="SET.description" tabIndex="100" title="Description *"
class="focusField" id="df_2_0" onfocus="return detailFocus(this);"
onblur="return detailBlur(this);" rows="4" cols="80">

i have tried several other attributes
.value
.innertext
.innerhtml
.outerhtml
.outertext

again they work offline but not on the server copy.
are server copys of textarea readonly as other input elemants on the webform work fine.
 
Tried it with the ("df_2_0") works if the webpage is saved offline but not on the live version becuse when you click in the text area a java script runs in the back ground on the live page unless their is a way to disable it i have to use send keys and clipboard commands. TBH after trawling through 5 diffrent VB fourms on textarea and getelement i dont think any one has a sold solution if java is used in the text area or text input elements or attributes.
 

Latest posts

Back
Top