hi,

what I would suggest, is that you need to remember that Javascript is doing all of its work in the user's browser. And Perl is working on the server.
what you do in this simple case... is have the submit button send the collected data to your script...

wile the user is filling in the form, you have either a monolithic Javascript function or object or lots of little functions working on the input data.

form fields have events... that you can attach these javascripts to... onBlur, onFocus, onClick on mouseOver, etc... so, let's say you want to check that the name and the password are at least filled in...:

you add a handler function which checks just that... however you will have to use logic.. and some human interface ergonomics...
so simple it is to have an annoying alert pop up... dig a little further and you can write directly into the page in an empty "div". and then finally, perhaps a global variable in Javascript... indicates whether all the tests are passed, and sure put them in the hidden fields to make url-encoded key/value pairs for your perl script to extract and perform all the real tests and send off to your data-store and finally let the user access the golden Home page of desire.

If that last bit was not clearly enough written, try to let a javascript function actually make the call as to when to set the page location to your script-url

once the perl script is satisfied... it then returns the URL for the page to which all this logging in was all about.

in short, it is time to start handing off some of the work to the new kid -- JS.

This is actually the only secret of WEB 2.0. and based on my searches on the net, PHP has taken over in most of those applications mostly because PERL is too powerful.

The other answers to this question clearly illustrate the singlemindedness and perhaps stubborness of PERL programmers, sure perl can do it all, but if the pass and login have invalid format, or illegal characters, it seems best to let the user know before he wastes the server's time with silly stuff. And you can have perl generate all of the Javascript and html/css into the login window, so detect your browser variables, write a hash and track the user with cookies: these are the power of your Perl.

In fact, since users are now running around with vast amounts of unused CPU power, have your PERL scripts send parts of huge problems out to user's javascipt engines and return the answers back to your script for futher routing and matrix processing, Turn your 1000's of clicks into a massively parallel network renderer...

...or, have I said too much?

In reply to Re: How to login to a form which has Javascript OnSubmit method usirng Perl by warblecl0x
in thread How to login to a form which has Javascript OnSubmit method usirng Perl by ragas

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.