if($q->param('product_key_text')){ # if was entered in the text field, # set it to product_key $q->param('product_key')=$q->param('product_key_text'); }