Generating a random string in some logical order
const setValue = ClientFunction(() => {
var dt = new Date();
var dateString =”Steve French Test – ” + dt.getTime();
document.querySelector(‘input[name=”ctl00$CPHSIURate$txtRiskName”]’).value =dateString;
document.querySelector(‘input[name=”ctl00$CPHSIURate$txtRiskName”]’).dispatchEvent(new window.Event(‘change’, { bubbles: true }))
});await setValue();
as well as
const setValue = ClientFunction(() => { document.querySelector(‘input[name=”CaptchaAgentValueAsSupplied”]’).value = document.querySelector(‘input[name=”CaptchaAgentValue”]’).value;});
await setValue();
to play with dates
const setValue = ClientFunction(() => { var dt = new Date(); dt.setDate( dt.getDate() – 10 ); var dateString = ((dt.getMonth() > 8) ? (dt.getMonth() + 1) : (‘0’ + (dt.getMonth() + 1))) + ‘/’ + ((dt.getDate() > 9) ? dt.getDate() : (‘0’ + dt.getDate())) + ‘/’ + dt.getFullYear(); document.querySelector(‘input[name=”ExpirationDateOfPriorCoverage”]’).value =dateString; document.querySelector(‘input[name=”ExpirationDateOfPriorCoverage”]’).dispatchEvent(new window.Event(‘change’, { bubbles: true }))});
await setValue();