Login box - <Enter>?

Does anyone know how to set a text box so when you enter data & then pres return it returns a command.

e.g.

I have a x2 Input text boxes, one for the username (single line type) & another for the password (in password type). They are both situated in an Mc. When I enter the dater & press <Enter> I want this to send a play(); command up one level.

Any ideas how I can do this?