Forum Discussion

aakash22's avatar
aakash22
Occasional Contributor
10 years ago

How to pass variable to eval(JavaScript) function

i have been trying to pass date value to my uneditable date filed. so i have retrieved the javascript ID(startDateCalendar_dateTextBox) for the field and i am trying to pass multiple values to the s...
  • HKosova's avatar
    10 years ago

    Is there a specific reason you're using eval? Can't you access the object directly like this?

    var obj = page.FindChildByXPath("//*[@id='startDateCalendar_dateTextBox']");
    
    // Or narrow down the search by specifying the HTML tag, for example: // var obj = page.FindChildByXPath("//input[@id='startDateCalendar_dateTextBox']");
    obj.value = ...;