I am creating a vbscript to automatically fill in a webpage. However, I am unable to figure out click on the final submit but as there is no id or tag.
<A onclick="submitForm('DefaultFormName',1,
{'wklEvent':'RR0','serverValidate':'1',event:'respond'});return false;"
href="#"><IMG border=0 alt=Approve
src="/OA_HTML/cabo/images/cache/en/bApprMsEb-6.gif" width=63 align=absMiddle
height=18></A>
Edit: I was able to get it working using the code below
Dim ele As Object
For Each ele In ie.Document.getElementsByTagName("a")
If InStr(ele.innerHTML, "bAdd_-X_1-7.gif") > 0 Then
ele.FireEvent ("onclick")
End If
Next ele
Related
I have a program where I'm going through tabs by clicking input submit buttons by pressing next or previous. My problem is when I click next it go to the next page and I click to reload the page up in the browser box it it basically go the the next page without me pressing next when I just want to reload the page here is my code for my page action for Next.
app_xval = session("app_xval")
if app_xval="X" then
upl.upload
upl.MaxFileSize = 50000000
page_action = upl.form("btnAction")
has_setup = upl.form("has_setup")
end if
if page_action = "Next" then
app_pg = app_pg + 1
session("app_pg") = app_pg
end if
<input type="submit" class="btn btn-sm btn-primary me-2" name="btnAction" value="Next">
I have some trouble working with laravel 8 & ReCaptcha.
I've a form, and inside it I've put a recaptcha v3. I want all my input required but when I press submit, only 2 of them are showing that I need to complete it (see the screen 1 below, sry its in french). When I put something inside the 2 input that tells me "YOU NEED TO WRITE SOMETHING THERE", and I submit then the form is working (even if I did not wite something on the others input which are normally required).
All my input have the required tag. The problem here come from the recaptcha button tag which is :
<button class="g-recaptcha btn" data-sitekey="myrecaptchakey" data-callback='onSubmit' data-action='submit' >
When I remove the class + date-sitekey + data-callback + data-action and adding type=submit its working well (see the screen 2 below).
How can I resolve this using recaptcha please ?
Cordially
Screen 1 :
Screen 2 :
EDIT : So, I've put that just before my button : <div class="g-recaptcha" data-sitekey="mycaptchakey"></div> and then my button should be <button class=" btn " type="submit"> and there is the result : It says that the key is not working
<input type="text" class="quantumWizTextinputPaperinputInput exportInput" jsname="YPqjbf"
autocomplete="off" tabindex="0" aria-label="Untitled question"
aria-describedby="i.desc.608035577 i.err.608035577"
name="entry.1790931838" value="" required="" dir="auto" data-initial-dir="auto"
data-initial-value="" aria-invalid="true">
The above is the HTML code of the input box which I would like to automatically fill with VBS.
<span jsslot="" class="appsMaterialWizButtonPaperbuttonContent exportButtonContent"><span class="appsMaterialWizButtonPaperbuttonLabel quantumWizButtonPaperbuttonLabel exportLabel">Submit</span></span>
And the above is the code for the submit button.
On Error Resume Next
Const PAGE_LOADED = 4
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("https://docs.google.com/forms/d/e/1FAIpQLScOmcmtdsrm3RiX7FD9ur2eLPULL9ZulSzKxjG87BblRky7hQ/viewform")
objIE.Visible = True
WScript.Sleep(3000)
IE.Document.getElementById("entry.1790931838").Value = "msdasdadm"
This is my code to auto-fill the form however I have not seemed to make it work. Also, I am not able to understand how to call the submit button and press that either.
This should get you started...
On Error Resume Next
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("https://docs.google.com/forms/d/e/1FAIpQLScOmcmtdsrm3RiX7FD9ur2eLPULL9ZulSzKxjG87BblRky7hQ/viewform")
objIE.Visible = True
WScript.Sleep(3000)
Dim input, inputs : Set inputs = objIE.document.getElementsByTagName("INPUT")
For Each input In inputs
If ("text" = input.getAttribute("type")) Then
input.value = "Just a test"
Exit For
End If
Next
Dim div, divs : Set divs = objIE.document.getElementsByTagName("DIV")
For Each div In divs
If ("button" = div.getAttribute("role") And "M2UYVd" = div.getAttribute("jsname")) Then
Call div.click()
Exit For
End If
Next
The Submit button is actually a parent DIV element with an associated JS onclick event handler defined. However, keep an eye on the jsname attribute, as the random name will most likely change between forms.
Hope this helps.
I have the following loop which displays images in a gallery:
<a href="#" v-for="(file, index) in files" v-bind:key="file.id" #click="file.selected = !file.selected">
<img :src="file.url" />
<span>{{file.name}}</span>
<i v-show="file.selected" class="fa fa-check-square"></i>
</a>
I would like to be able to select any image by clicking on it.
But nothing happens when I click on the image.
I did it the way I would do it in AngularJs - I modify the item within the loop.
I was expecting that:
- the view (inside of the loop) will be updated
- the change of the item will be taken over into the data array (files)
Ok, that was easy - it did not work the way I wanted, because I did not add a key "selected" to my initial data array.
In AnguarJS this would not matter - the key would just be added, but here the element is not known / watched if it does not exist from the beginning.
I have created a VBScript function OnRefreshList() which is called on the click of a button "Refresh List".
Sub OnRefreshList ()
Initdatatable(false)
if ReadFilters() = false then
msgbox "It is not possible to refresh the whole orders list. Please enter more filters"
exit sub
end if
End Sub
The "Refresh List" button is defined as
<td class="button cmd" valign="center" nowrap id="cmdRefresh" onclick="OnRefreshList()" title="Refresh the order list">Refresh List</td>
This function is working fine when I am clicking on the button.
Now I want to call this function when I press the Enter key from the key board.
For this I tried to change the following piece of code but it didnt worked for me.
<td class="button cmd" valign="center" nowrap id="cmdRefresh" onKeydown="vbscript: if (event.keyCode==13) then OnRefreshList()" onclick="OnRefreshList()" title="Refresh the order list">Refresh List</td>
Please help me if anyone has an answer to it.
Your onKeydown event does not have a correct VBScript statement in it. It should be:
onKeydown="vbscript: if event.keyCode=13 then OnRefreshList()"
Notice the single = sign and the lack of parenthesis (they are not mandatory). If you are more comfortable with javascript: You can mix VBScript and Javascript:
onKeydown="javascript: if (event.keyCode==13) OnRefreshList(); //this will work too!"