integrated form field data into function