I have written some javascript to concatenate an input field and a Radio Button to populate a third field. I thought I had made it so that the third field holding the result would not appear until there was data in both the input field and the radio button, but this does not seem to be the case. What am I missing in my code:
//format for inputted time
var TimeFormat = "h:MM";
// field names
var str1Field = "TimeIn"
var str2Field = "TimeInTT"
// get field values
var str1 = this.getField(str1Field).value;
var str2 = this.getField(str2Field).value;
// concat strings if there is data
if(str1 != "" && str2 != ""){
var res = (TimeFormat, str1) + " " + str2;
event.value = res;
}
Thank you!
//format for inputted time
var TimeFormat = "h:MM";
// field names
var str1Field = "TimeIn"
var str2Field = "TimeInTT"
// get field values
var str1 = this.getField(str1Field).value;
var str2 = this.getField(str2Field).value;
// concat strings if there is data
if(str1 != "" && str2 != ""){
var res = (TimeFormat, str1) + " " + str2;
event.value = res;
}
Thank you!
Comment