1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

hey can some have a look at this for me :)

Discussion in 'JavaScript' started by DMC1992, May 10, 2010.

  1. #1
    hey can someone take a look at this for me im not fully sure if it will pass, its part of my technical documentation for collage, heres the website its made on
    http://joes-fruit-shop.orgfree.com/Joe's%20Fruit%20Shop%20Order%20Form.html

    The project....
    Task 2
    You should, in conjunction with developing your order form, also produce technical and user documentation for your script. I have provided several links below that discuss writing software documentation to help get you started.

    My work....
    The Java script for Joe's Fruit Shop was created using Dream Weaver CS4, a form was created then the “Validate Form”function was used, Code View was used to debug the Java Script. All of the HTML was created using Dream Weaver and debugged using Code View the site was uploaded using SmartFTP Client and hosted by www.orgfree.com.

    Tables were used for the main layout of the form, Horizontal Rules were used to separate each area of the form.

    A video of the Validating form function in Dreamweaver can be viewed by clicking the link bellow the same method was used to create the JavaScript on the Joes Fruit Shop site. http://www.youtube.com/watch?v=KpJnwbyxUE4

    All of the areas that contain a “*” symbol next to them must be filled in to complete the form if those areas are not filled in and submit is clicked a Message box will appear alerting the user of what fields haven’t been filled.

    Number fields have been created so the user can’t enter letters into fields such as “Post Code” “Home Phone” and so on. If the user does enter letters into these fields a message will appear alerting the user.

    Drop down boxes where used though out the site and the user must select one option within each drop down, if no selections are made and submit is clicked the empty dropdowns will turn red alerting the user to select an option.

    A clear form button is also included allowing the user to clear the form of any information they may have entered, also a submit button that will allow the user to submit the form.

    Areas on the form that where included:
    Your details and delivery address:
    • Full Name (letters only field)
    • Home Phone (numbers only field)
    • Mobile Phone (numbers only field)
    • Address (number and letter field)
    • State (menu drop down)
    • E-Mail ( “@” symbol is required for this field)
    • Work Phone (numbers only field)
    • City/Suburb (letters only field)
    • Post Code (numbers only field)

    Credit card details:
    • Card Type (menu drop down)
    • Expiry date Month/Year (menu drop down)
    • Card number (numbers only field)
    • Card holder's name (letters only field)

    Purchase details:
    • Items (menu drop down) in total 5 item menu for selection
    • Quantity (menu drop down) in total 5 item menu for selection


    //This area of the code will set out the rules/guidelines of the form, for example an @ symbol must be used within an E-mail area, or only numbers are to be entered into the postcode area.
    <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    function MM_validateForm() { //v4.0
    if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args);
    if (val) { nm=val.name; if ((val=val.value)!="") {
    if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
    if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
    } else if (test!='R') { num = parseFloat(val);
    if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
    if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
    min=test.substring(8,p); max=test.substring(p+1);
    if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
    } }
    //-->
    </script>

    //Input area for Full Name
    <input name="Your full name" type="text" id="Your full name" size="50" />

    //Input area for Work phone number
    <input name="Work" type="text" id="Work" />

    //Input area for Home contact phone number
    <input name="Your home contact number" type="text" id="Your home contact number" />

    //Input area for Mobile phone number
    <input name="Mobile" type="text" id="Mobile" />

    //Input area for delivery address
    <input name="Address" type="text" id="Address" size="70" />

    //Input area for City/Suburb
    <input name="City/Suburb" type="text" id="City/Suburb" size="30" />

    //Adds the object State type and
    // sets options for object State type
    <select name="select13" id="select13">
    <option>Select a state</option>
    <option value="1">QLD</option>
    <option value="2">VIC</option>
    <option value="3">NSW</option>
    <option value="4">WA</option>
    <option value="5">NT</option>
    <option value="6">ACT</option>
    <option value="7">SA</option>
    <option value="8">TAS</option>
    </select>

    //Input area for Post code
    <input name="Post code" type="text" id="Post code" size="10" />

    //Input area for E-mail address
    <input name="Email address" type="text" id="Email address">

    //Adds the object Card type and
    // sets options for object Card type
    <select name="Card type" id="Card type">
    <option>Please select card type</option>
    <option value="1">Visa</option>
    <option value="2">Master Card</option>
    <option value="3">AMX</option>
    </select>

    //Adds the object Month type and
    // sets options for object Month type
    <select name="Month" id="Month">
    <option>Month</option>
    <option value="1">Jan</option>
    <option value="2">Fab</option>
    <option value="3">Mar</option>
    <option value="4">Apr</option>
    <option value="5">May</option>
    <option value="6">Jun</option>
    <option value="7">Jul</option>
    <option value="8">Aug</option>
    <option value="9">Sep</option>
    <option value="10">Oct</option>
    <option value="11">Nov</option>
    <option value="12">Dec</option>
    </select>

    //Adds the object Year type and
    // sets options for object Year type
    <select name="Year2" id="Year2">
    <option>Year</option>
    <option value="1">2009</option>
    <option value="2">2010</option>
    <option value="3">2011</option>
    <option value="4">2012</option>
    <option value="5">2013</option>
    </select>

    //Input area for Credit card number
    <input name="Credit card number" type="text" id="Credit card number"></td>

    //Input area for Card holders name
    <input type="text" name="Card holders name" id="Card holders name">

    //Adds the object Item type and
    // sets options for object Item type
    <select name="select1" id="select1">
    <option>Item</option>
    <option value="0">No item</option>
    <option value="1">Alfalfa sprouts $1.50 per punnet</option>
    <option value="2">Apples, Bonza $5.99KG</option>
    <option value="3">Apples, Golden Delicious $4.99KG</option>
    <option value="4">Artichoke hearts, pickled $17.99KG</option>
    <option value="5">Avocados, dark, large 2 for $3.50</option>
    </select>

    //Adds the object Quantity type and
    // sets options for object Quantity type
    <select name="select2" id="select2">
    <option>Quantity</option>
    <option value="0">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    </select>

    //This area of the code checks the values of each of the Input and Selection boxes if no input/selection is made within one of the required areas the java script will report a fouls reading and a message box will appear alerting the user
    <input name="submit" type="submit" id="button" onClick="MM_validateForm('Your full name','','R','Work','','NisNum','Your home contact number','','RisNum','Mobile','','NisNum','Address','','R','City/Suburb','','R','Post code','','RisNum','Email address','','RisEmail','Credit card number','','RisNum','Card holders name','','R');return document.MM_returnValue" value="Submit"></td>

    //This area of the code will reset the form for the user
    <label>
    <input type="reset" name="Clear" id="Clear" value="Clear">
    </label>
     
    DMC1992, May 10, 2010 IP
  2. bprashanth.gi

    bprashanth.gi Active Member

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #2
    Like I said, you could also include the limitations and possible extensions (like user photo upload etc.) of the page you've designed.
    You could also include a paragraph with few lines as conclusion.
     
    bprashanth.gi, May 10, 2010 IP
  3. DMC1992

    DMC1992 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok shall do, hows it look so far tho? on the right track?
     
    DMC1992, May 11, 2010 IP
  4. bprashanth.gi

    bprashanth.gi Active Member

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #4
    Yup, on the right track till now. If possible, try to include pictures illustrating things that you mention.
     
    bprashanth.gi, May 11, 2010 IP