Results 1 to 6 of 6

Thread: Trouble building an online application form

  1. #1
    Join Date
    Sep 2008

    Trouble building an online application form

    As the title suggests, I am trying to build an online application form. My knowledge of PHP and Javascript is quite limited. Basically what I need is:

    1) HTML fields laid out either on 3 pages or in DIVs that change in visibility providing the illusion of pages

    2) 4-5 fields allowing attachments to be uploaded

    3) Validation to make sure that required fields are filled out (without leaving the page, without waiting until end of all the pages)

    4) A method by which to email the form results to a specified address

    5) An autoresponder

    I started with Jack's Formmail which provided a way to email the form results, and it also included validation, an autoresponder, and attachments.
    Problems: The script didn't have a way of incorporating multi-page forms (which led me to finding the technique of hiding/showing DIVs with 'next'/'prev' buttons instead) Also, the validation happens when a user clicks 'submit', and it loads another page telling you there are errors, making the user click the back button to get back to the form- not what I want, and it doesn't work with multi-page forms.

    So at first I tried unsuccessfully to find a free form-mailer that supported multi-pages... then I followed a tutorial (can't find it again) that basically made use of changing the display property on each section's DIV from 'none' to 'block' all the way down so that it seems like multiple pages.

    Then I came across this script, which validates and then displays the errors on the page itself.
    Problem: It validates when the user clicks 'submit', so if I were to use the technique of hiding/showing DIVs, then the user wouldn't be told there was a problem until the end- and then would have to click back like 4 times... (I don't know how to change the script so that it validates with the 'next' button)

    So as it stands right now, I could make everything work if I left it on one long page, or I could have it work with the multiple pages, but then it wouldn't validate until the end- neither option is quite what I want.

    You can click here to see an example form I made to test it all out that shows the DIV switching, but it doesn't validate until the last section. (I only made First and Last names required fields)

    I think my problems would be solved if I could make the script validate when a user clicks 'next' OR 'submit' rather than only 'submit' if you get what I'm saying... is that relatively possible?

    Any help is a appreciated.

  2. #2
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    Could be (simplified) something like this:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    <html xmlns="http://www.w3.org/1999/xhtml">
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    .visible {
    <script type="text/javascript">
    function valid(w){
    var cases={
    var div=w.parentNode;
    var txt=div.getElementsByTagName('input'), i=0, t;
    if(t.type=='text'&&t.value.length<1){alert('Please, fill the fields!');return}
    function goDiv(from,to){
    <form id="myForm" action="">
    <div id="one" class="visible">
    Name: <input type="text" name="name" id="name" />
    <br />
    <input type="button" value="Next" onclick="valid(this)" />
    <div id="two" class="hidden">
    Address: <input type="text" name="address" id="address" />
    <br />
    <input type="button" value="Next" onclick="valid(this)" />
    <div id="three" class="hidden">
    Contact: <input type="text" name="contact" id="contact" />
    <br />
    <input type="button" value="Submit" onclick="valid(this)"/>

  3. #3
    Join Date
    Oct 2008
    Melbourne, Australia

    Thumbs up


    So at first I tried unsuccessfully to find a free form-mailer that supported multi-pages
    Tectite FormMail is free, anti-spam, and supports multi-page forms.

    The problem with using JavaScript is that a percentage of your visitors do not have JavaScript enabled, and will not be able to use your forms.


  4. #4
    Join Date
    Dec 2003
    Bucharest, ROMANIA
    Quote Originally Posted by rustyr View Post
    The problem with using JavaScript is that a percentage of your visitors do not have JavaScript enabled, and will not be able to use your forms.
    Anyway, this kind of project needs javascript for the other requirements as well, thus the objection is not quite sustainable.

    Usually, people disable javascript when visiting untrusted sites. Untrusted sites (except maybe the porno ones ) have low SEO ranks. But for a e-commerce site, for instance, the rank is vital, thus the trust should be high.

    Now here's a logical conclusion: users do enable javascript when visiting trusted sites so that there is no reason for avoiding javascript in development.

    Statistics say the same: general percentage of javascript disabled users may be around 5-6%, but on the known and trusted sites disabled javascript users are far below 2%, which is an acceptable loss. Anyway, that shows the dual behavior: the same user might opt for disabling javascript in certain situations and enable it in others.

    As a conclusion: the javascript accessibility problem is not a vital problem anymore.

  5. #5
    Join Date
    Sep 2008
    Thanks a lot for the replies.

    I see what you mean Kor, but I just don't think I would be able to make the necessary edits to the Javascript in order to suit my needs, the example that I put up was based on the script, my understanding of it all is pretty limited...

    I saw Tectite when I was looking around, but I misread it and thought I needed to purchase a license; I didn't realise that was only if I wanted to encode the information, which since I'm not dealing with credit cards,etc- I don't, so that may very well work.

    And yeah, I'm not too concerned with the Javascript 'issue' for the reasons Kor mentioned, and also there's a section where users can apply offline if it doesn't work for them anyway, so no big deal...

    Thanks again, I hope it all works!

  6. #6
    Join Date
    Sep 2008
    phpFomGenerator provides an online open source solution. the forms created do contain a couple of html errors, but they are easy to spot and fix. the javascript validation included works and you can easily modify the code to suit your needs.


    ...and it's free!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.37288 seconds
  • Memory Usage 2,902KB
  • Queries Executed 15 (?)
More Information
Template Usage (34):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates