cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mareeswaran
Dynatrace Helper
Dynatrace Helper

With help of JavaScript Event, we can extract the value of input field and add the conditional JavaScript code(if else condition) to check if its expected or default or empty value.

 

image7.jpg

 

For example, consider that current input field is assigned with the default value "Dynatrace" then we can try use the below JS code to check the same,

 

var currentvalue = document.querySelector("#name").value;

var valuetobechecked = "Dynatrace";
if(currentvalue == valuetobechecked)
{
//console.log("current value matches with the expected one");
api.info("current value matches with the expected one");
}
else if(currentvalue.length>0)
{
//console.log("current value not matches with the expected one. Actual Value: " + currentvalue);
api.info("current value not matches with the expected one. Actual Value: " + currentvalue);
//add additional code if its different value.
}
else
{
//console.log("Empty value");
api.info("Empty value");
//add additional code if its empty value.
}

 

Version history
Last update:
‎10 Jul 2024 03:41 PM
Updated by:
Comments
ChadTurner
DynaMight Legend
DynaMight Legend

Very Useful information! thank you!