Page 1 of 1

Browser widget: set value of password input [Solved]

Posted: Tue Jun 25, 2024 9:15 am
by Cairoo
Hi all

I have a password type input on a form in a browser widget.

I get an error when I try to set the input's value like so:

Code: Select all

do "document.getElementById('login_passwd').value = 'myPassword'" in widget "Browser1"
The error says,
LCB Error Value is not of correct type for assignment to variable - expected type <type: livecode.lang.string> for assigning to variable tResult in com.livecode.widget.browser.browserEvaluateJavaScript
Object Browser1
LCB File browser.lcb
LCB Line 864
What am I doing wrong?

Re: Browser widget: set value of password input [Solved]

Posted: Tue Jun 25, 2024 10:53 am
by Cairoo
I've just now discovered that the password input actually has no id attribute, so that's why there's an error.

I will now close this topic because I don't want to waste anyone else's time.