# Prompt box

**URL:** <https://www.ruby-forum.com/t/prompt-box/109773>\
**Category:** Rails\
**Created:** [July 18, 2007, 11:44pm UTC](https://www.ruby-forum.com/t/prompt-box/109773 "2007-07-18T23:44:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [July 18, 2007, 11:44pm UTC](https://www.ruby-forum.com/t/prompt-box/109773/1 "2007-07-18T23:44:43Z")

</div>

I need to add a prompt to a form whenerver someone tries to submit so  
bad data. Basically what I have is a form that takes credit card info.  
On submit a method gets called that validates the card number. If that  
validation fails, I would like a prompt box to show-up and indicate that  
an ‘Invalid Card Number’ was entered. I add the following to my  
remote\_form helper:

:failure =\> “alert(‘ERROR’)”

It works, but not quite right. My question is, can I call prompt in a  
method in my controller and not as an attribute of the form tag? That to  
me would make more sence. I don’t know how to do that, however. Anyone  
have any ideas or alternatives that might work? Thanks,

~S
