Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I've been working on a web form that allows a user to fill in some parameters like url, link depth, images parameters and such.

When they submit the form, I currently do the following:

  1. Fetch the URL and extract all of the links found on the main page, returning a count
  2. Convert the content into another non-HTML format
  3. Display a configuration stanza so the user can use it to reproduce the same action on their own local machine at a later time,
  4. Present the user with the non-HTML converted file format for download ("Save As...")
  5. etc..

What I'd like to try to do, is make the form more usable for users, without the need to issue a Submit to return much of the basic results.

I'm not looking for "javascript form valdiation", but something to actually perform an action on the server-side every time the user moves between form fields.

For example, the user enters a URL into a textfield, and as they tab to the next form element, I'm fetching the URL they've entered and returning the count of links found, as they continue to fill out the rest of the form and before they submit the form.

Enter AJAX..

Have any monks implemented AJAX form validation and XMLHttpRequest style objects and server calls with all of the form and backend processing handled via Perl itself?

I'm looking for gotchas, pointers, samples and other things I can use to learn how to do this.

Barring that, is there another approach to making the form more usable for everybody's grandmother, without using AJAX or client-side validation tricks?

Thanks!


In reply to AJAX'ifying a web form and dynamic server validation through Perl by hacker

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-20 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found