public void setAnswer ( String variable , int value ) { FormField field = getField ( variable ) ; if ( field == null ) { throw new IllegalArgumentException ( "Field not found for the specified variable name." ) ; } validateThatFieldIsText ( field ) ; setAnswer ( field , value ) ; }
Sets a new int value to a given form s field . The field whose variable matches the requested variable will be completed with the specified value . If no field could be found for the specified variable then an exception will be raised .