in reply to Create pop up error message in Perl

If user tries to enter 11th digit a pop up error message should be generated ... Can I do this in Perl?

As Perl runs on the back end, you'd have to send a request to the server for every key stroke, otherwise how would the back end be supposed to know what the user has typed so far?   So, in short, I'd say: No, this can't practically be done with Perl1. (Use JavaScript instead.)

___

1 Update: ...with Perl alone plus standard HTML forms, that is. Of course, you could use Ajax. (But think twice before you decide to do so - depending on client-server round trip times, it might not be the best idea to call a server-side function for every key stroke.  As you'll need client-side Javascript (or VBScript, etc.) anyway for the Ajax glue code, it's almost certainly better to implement such a simple task as checking the length of an input string, in that client-side scripting language right away...)

  • Comment on Re: Create pop up error message in Perl

Replies are listed 'Best First'.
Re^2: Create pop up error message in Perl
by Rocko19 (Acolyte) on Feb 11, 2009 at 11:43 UTC

    Hi almut,

    If we take the the data user has entered in the phone field and then checks its format and if its greater then 10 digits can we throw an error message in Perl?

    Thanks

    Rocko19