LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to click the login button that coded as javascript not form submit button in labview

I want to login webpage through labview. I can open the webpage, input the password, but I can find the name id for the 'login' button. Base on code, the 'login' button is coded as javascript not form submit.  Any idea how I can click that 'login' button.  The portion of webpage is like:

<br />
<form name="logform" action="login" method="post" onsubmit="ProcessForm()">
<div class="container">
<br />
<input type="password" placeholder="Enter Password" name="password" value="" required>
<br />
<button>Login</button>
<br />

 

The ProcessForm() is the function

 

Thanks for your help

0 Kudos
Message 1 of 4
(4,519 Views)

You can try using the javascript click() method as outlined in the following link:

HTML DOM click() method - https://www.w3schools.com/jsref/met_html_click.asp

 

The following link might also be useful to learn more:

Simple JavaScript and HTML with LabVIEW Web Services - http://forums.ni.com/t5/LabVIEW-Web-Development/Getting-Started-Series-Simple-JavaScript-and-HTML-wi...

 

Please let me know if you have any questions.

0 Kudos
Message 2 of 4
(4,464 Views)

Thanks Shreyas.

But in example, the clicked button all has "id"  and you can get that element name.  In my case, I can not find the element for that login button.

0 Kudos
Message 3 of 4
(4,448 Views)

Is it possible for you to add a custom "id" element to the code?

0 Kudos
Message 4 of 4
(4,434 Views)