Results 1 to 3 of 3

Thread: JAVASCRIPT Loadform()

  1. #1
    Join Date
    Dec 2013

    JAVASCRIPT Loadform()

    I been working on this problem for two days and have gotten no where. Tried tutorial on http://www.w3schools.com/jsref/met_html_focus.asp to no avail. If anyone can guide me in the right direction. Problem then code below:
    Within the <script> tags create a function named loadform() that displays current date in the form date field and then moves the cursor focus to the qtyl field and selects it. Hint - apply both the focus () and select methods to the qtyl input field. Run the loadform function when the page is loaded.

    <title>GPS-ware Order Form Second Draft</title>
    body {background-image: url(border.jpg); background-position:left;
    background-repeat: repeat-y; margin-top:0; padding-top:0}
    #logo {border-bottom-style: solid;
    #links {color:green; font-family:Arial, Helvetica, sans-serif; font-size:8pt}
    #links a {color:black; text-decoration:none}
    #links a:hover {color:black; text-decoration:underline}
    #prodtable {margin:10px};
    td {font-size:8pt; font-family: Arial, Helvetica, sans-serif}
    .numbers,.date {text-align:right; background-color:lightyellow}
    .quantity {text-align:right}
    .fmlabel {color:brown}
    <script type="text/javascript" src="autofillSelect.js"></script>
    function dollars(n) {
    return (n == Math.round(n)) ? n += ".00" : (n*10 == Math.round(n*10)) ? n +="0" : n;

    function todaytxt() {
    var Today=new Date("October, 11, 2004");
    return Today.getMonth()+1+"/"+Today.getDate()+"/"+Today.getFullYear();
    function loadform() {


    <table width="620" cellpadding="0" cellspacing="5">

    <!-- LIST OF LINKS -->
    <td id="links" valign="top" width="100" rowspan="7">
    <a href="#">Home Page</a><br>
    <a href="#">Product Catalog</a><br>
    <a href="#">Order Form</a><br>
    <a href="#">Maps Online</a><br>
    <a href="#">Contact Us</a><br><br>
    <a href="#">Countries</a><br>
    <a href="#">States</a><br>
    <a href="#">National Parks</a><br>
    <a href="#">Hiking Trails</a><br>
    <a href="#">Cities</a><br>
    <a href="#">Astronomical</a><br>
    <a href="#">Natural</a><br><br>
    <a href="#">GoMap 1.0</a><br>
    <a href="#">Drive Planner 2.0<br>
    <a href="#">Hiker 1.0</a><br>
    <a href="#">G-Receiver I</a><br>
    <a href="#">G-Receiver II</a><br>
    <a href="#">G-Receiver III</a><br><br>
    <a href="#">Downloads</a><br>
    <a href="#">Tech Support</a><br>
    <a href="#">FAQs</a>

    <td id="logo" valign="top" width="520" colspan="2">
    <img src="gpsware.jpg" alt="GPS-ware">


    <!-- START OF ORDER FORM -->
    <form name="order" method="post">
    <h1 style="margin-bottom:0px">Order Form</h1>

    <!-- FORM DATE -->
    <td align="right">
    <input id="date" name="date" />
    <script type="text/javascript">
    document.getElementById("date").value = new Date();


    <!-- PRODUCT FIELDS -->
    <td valign="top" colspan="2">
    <legend>Enter the quantity of each product and press the Tab key</legend>
    <table border id="prodtable" cellpadding="5">
    <th width="200">Product</th>
    <td>GoMap 1.0</td>
    <td><input class="numbers" name="price1" size="7" value="19.95" disabled></td>
    <td><input class="quantity" name="qty1" size="7"></td>
    <td><input class="numbers" name="sub1" size="7" value="0.00" disabled></td>
    <td>Drive Planner 2.0</td>
    <td><input class="numbers" name="price2" size="7" value="29.95" disabled></td>
    <td><input class="quantity" name="qty2" size="7" value="0"></td>
    <td><input class="numbers" name="sub2" size="7" value="0.00" disabled></td>
    <td>Hiker 1.0</td>
    <td><input class="numbers" name="price3" size="7" value="29.95" disabled></td>
    <td><input class="quantity" name="qty3" size="7" value="0"></td>
    <td><input class="numbers" name="sub3" size="7" value="0.00" disabled></td>
    <td>G-Receiver I</td>
    <td><input class="numbers" name="price4" size="7" value="149.50" disabled></td>
    <td><input class="quantity" name="qty4" size="7" value="0"></td>
    <td><input class="numbers" name="sub4" size="7" value="0.00" disabled></td>
    <td>G-Receiver II</td>
    <td><input class="numbers" name="price5" size="7" value="199.50" disabled></td>
    <td><input class="quantity" name="qty5" size="7" value="0"></td>
    <td><input class="numbers" name="sub5" size="7" value="0.00" disabled></td>
    <td>G-Receiver III</td>
    <td><input class="numbers" name="price6" size="7" value="249.50" disabled></td>
    <td><input class="quantity" name="qty6" size="7" value="0"></td>
    <td><input class="numbers" name="sub6" size="7" value="0.00" disabled></td>
    <td colspan="3" align="right"><span class="fmlabel">Sales Tax:</span>
    <td><input class="numbers" name="sub7" size="7" value="0.00" disabled></td>
    <td colspan="3" align="right"><span class="fmlabel">Shipping:</span>
    <select name="shipping">
    <option value="0">Select a Shipping Method
    <option value="7.95">3-5 days ($7.95)
    <option value="9.95">2 days ($9.95)
    <option value="12.95">Next Day ($12.95)
    <td><input class="numbers" name="sub8" size="7" value="0.00" disabled></td>
    <th colspan="3" align="right" bgcolor="pink">TOTAL</th>
    <td bgcolor="pink"><input class="numbers" name="total" size="7" value="0.00" disabled></td>

    <td valign="top" colspan="2">
    <legend>Shipping Address</legend>
    <td><span class="fmlabel">E-mail:</span></td>
    <input name="email" size="40">
    <td><span class="fmlabel">Name:</span></td>
    <input name="name" size="40">
    <td width="70" valign="top"><span class="fmlabel">Street:</span></td>
    <textarea rows="3" cols="40" name="street"></textarea>
    <td width="70" valign="top"><span class="fmlabel">City:</span></td>
    <input size="30" name="city">
    <span class="fmlabel">State:</span>
    <select name="state">
    <span class="fmlabel">ZIP:</span>
    <input size="10" name="zip">

    <td valign="top" colspan="2">
    <legend>Credit Card Information</legend>
    <table width="100%">

    <!-- CARD TYPE -->
    <td width="70" valign="top"><span class="fmlabel">Card:</span></td>
    <td colspan="3">
    <select name="ccard">
    <option value="">Select a Credit Card
    <option value="ae">American Express
    <option value="cc">CitiBank
    <option value="dn">Diner's Club
    <option value="di">Discover
    <option value="mc">MasterCard
    <option value="vi">Visa

    <!-- NAME ON CARD -->
    <td width="70" valign="top"><span class="fmlabel">Name:</span></td>
    <td colspan="3">
    <input size="40" name="cname">


    <!-- CARD NUMBER -->
    <td width="70" valign="top"><span class="fmlabel">Number:</span></td>

    <td colspan="3">
    <input type="password" size="20" name="cnumber">
    <span class="fmlabel">Expiration:</span>
    <select name="expmonth">
    <select name="expyear">


    <td align="center" colspan="2">
    <input type="submit" value="Submit Order">



    <form name="dform">
    <input type="text" name="currentdate" size=11>

  2. #2
    Join Date
    May 2006
    Somewhere behind your screen
    may be this is because there is no qtyl input field in your code?

    p.s. the <code></code> tags usually look like [code][/code]
    signature under construction

  3. #3
    Join Date
    Oct 2013
    Perhaps it should be qty1?

    <input class="quantity" name="qty1" size="7">

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.12505 seconds
  • Memory Usage 2,892KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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 (72):
  • 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_postinfo_query
  • fetch_postinfo
  • 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