Form Steps

 blood:-

// bloodgrp

const selectElement = document.querySelector('select[formcontrolname="bloodGroup"]');

const optionToClick = Array.from(selectElement.options).find((option) => option.textContent === 'Under Investigation - Result will be updated soon');


if (optionToClick) {

  optionToClick.selected = true;

  selectElement.dispatchEvent(new Event('change', { bubbles: true }));

}

______________________________________________________________________

-----------------------------------------------------------------------


date:- 

//date & medium

const dateInput = document.querySelector('[formcontrolname="admnStartDate"]');

dateInput.value = '12/06/2019';

dateInput.dispatchEvent(new Event('input', { bubbles: true }));


const selectElement = document.querySelector('select[formcontrolname="mediumOfInstruction"]');

const optionToClick = Array.from(selectElement.options).find((option) => option.textContent === ' 19-English ');


if (optionToClick) {

  optionToClick.selected = true;

  selectElement.dispatchEvent(new Event('change', { bubbles: true }));

}

------------------------------------------------------------------------

radio:-

// radio

const radioButtons = document.querySelectorAll('input[type="radio"][value="2"]');

radioButtons.forEach((radioButton) => {

  radioButton.click();

});

-------------------------------------------------------------------------

Comments