1

I'm new in JavaScript and wish to create something that can help my company to do some automated work.

I am creating a chrome extension to trace time in motion of my colleagues dairy work on the browser.

Basically the chrome extension will capture userName and click event and submitting to Office 365 Excel form by using URL Query String window.open(URL&userName) and setAttributes("Value", userName) then getElementbyId("button").click() to submit the form, but it unable to pass thru as the value will be reset and error will show "the answer is required" Anything I missed out?

document.getElementsByClassName("office-form-question-textbox office-form-textfield-input form-control border-no-radius")[0].setAttribute("value","CCC") document.getElementsByClassName("button-content")[7].click()

these are 2 line code i ran in javascript. ExcelFrom Image

I found solution for Google Form to silent submission.and i wish to make it work with Office 365 Excel Form.

Thanks.

Dan Ong
  • 11
  • 2
  • I think, you need check docs on click events/trigger https://stackoverflow.com/questions/2381572/how-can-i-trigger-a-javascript-event-click – Rafee Nov 14 '19 at 09:41
  • Thank for your comment. I able to do a element.click() in console if I manually type in the answer. But it not work if I ran it with setAttribute("value", answer). – Dan Ong Nov 14 '19 at 11:13
  • wow you got lot of classnames, use only 1 or call by name – Rafee Nov 15 '19 at 01:30
  • this is only way i can think of to getEelement and setAttribute(value). there is no name for excel form like google form. – Dan Ong Nov 15 '19 at 04:17

0 Answers0