In NewForm.aspx i have three fields (StartTime, Duration, And EndTime), When user fill StartTime and Duration, I want javascript to calculate and fill EndTime automatically. I cant use:
_spBodyOnLoadFunctionNames.push("...");
because on onload the StartTime and Duration are not filled yet. So I tried:
var control = getTagFromIdentifierAndTitle("input", "", "StartTime");
control.observe('change', function(){alert('ola')});
Event.observe('change', function(){alert('ola')});
*for the sake of test, i put starttime as normal text field.
It didnt worked either. I dont want to create new NewForm1.aspx and do everything manually because if i do so i will have to actualize this form everytime new fields are added in the list. So i want to acomplish it in javascript. Do you have any idea how can i accomplish it?