if statements and add value to  hidden elements