Exceedinglife's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
72 (0.08 per day)
Joined:
01-July 12
Profile Views:
957
Last Active:
User is offline Dec 11 2014 10:24 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Subaru
Dream Kudos:
0
Icon   Exceedinglife has not set their status

Posts I've Made

  1. In Topic: making method in an unordered list for organizing

    Posted 10 Dec 2014

    the choices are coming from a sharepoint list so the manager of the restaurant can just add a item to the list and it will automatically put them in the control whenever she decides to add new items

    i just have to add some padding / margin to the controls to add more space

    I talked about having cheese separated but she is doing the cost the same as meat / cheese so you only allowed so many before and extra charge is added

    i want each row to contain 3 - 4 items then for it to make a new row
  2. In Topic: making method in an unordered list for organizing

    Posted 10 Dec 2014

    right now i have it in a fieldset

    my list of checkboxes are in 1 row

    i want 3 or 4 rows instead of 1 so it looks alot more neat

    Posted Image

    	<!-- Select fillings -->
            <div id="selectFillings">
                <div id="fillingValid" class="validation alert"></div>
                <fieldset id="fillings">
                    <legend><h4>4). Choose up to two fillings (Extra + $1.20)</h4></legend>
                    <table id="fillingsTable"></table>
                </fieldset>
            </div>
    
        function initializeCheckBox(elementName, dataService, render, name) {
            if (render === null) render = function(item) { return(item.text); };
            var $element = $(elementName);        
            $.when(dataService()).then(function (data) {
                var $unorderedList = $('ul class="stylebox"');
                $element.append($unorderedList);
                console.log($unorderedList);
    
                for (var itemIndex in data) {
                    var $input = $('<input type="checkbox" name ="'+name+'" value="' + data[itemIndex].value + '">' + render(data[itemIndex]) + '</input>');
                    var $row = $('<li>'); 
                    $input.data(data[itemIndex]);
    				$input.appendTo($element);
                }
            });
        }
    
        function initializeRadioBtn(elementName, dataService) {
            var $element = $(elementName);
            $.when(dataService()).then(function (data) {
                for (var itemIndex in data) {
                    var $input = $('<input type="radio" name ="Side" value="' + data[itemIndex].value + '">' + data[itemIndex].text + '</input>');
    				$input.data(data[itemIndex]);
    				$input.appendTo($element);
                }
            });
        }
    
         */
        function getFillings() {
            var deferred = new $.Deferred();
            deferred.resolve([
                { value: 'Turkey Breast', text: 'Turkey Breast', price: 0.0 },
                { value: 'Baked Ham', text: 'Baked Ham', price: 0.0 },
                { value: 'Salami', text: 'Salami', price: 0.0 },
                { value: 'Cheddar Cheese', text: 'Cheddar Cheese', price: 0.0 },
                { value: 'Swiss Cheese', text: 'Swiss Cheese', price: 0.0 },
                { value: 'Provologne Cheese', text: 'Provologne Cheese', price: 0.0 },
                { value: 'Veggie Mix', text: 'Veggie Mix', price: 0.0 }
            ]);
            return (deferred);
        }
    
    
  3. In Topic: making method in an unordered list for organizing

    Posted 10 Dec 2014

    I am working on making a online ordering site for a restaurant. for example like how you can order dominoes pizza online or subway.
    I am working with a restaurant on making it so you can order food online.
    I have everything set up and working pretty good right now.

    The reason i want these checkboxes in a unordered list is so i can style it.
    my checkboxes currently are displayed in one long list
    I would like to have them in rows of 3 or 4 boxes per row.

    my code (this method) grabs data from a collection and displays it as checkboxes in its certain section on the page.
    This is just one method of my many for this site.

    I have been trying many different orders and differnt things to try to get this to work but i did not yet.
    this is my most current sample

    if you know a better solution then an unordered list to style my checkboxes i am grateful to hear it.

        function initializeCheckBox(elementName, dataService, render, name) {
            if (render === null) render = function(item) { return(item.text); };
    		var $element = $(elementName);
    		$.when(dataService()).then(function (data) {
    		    //HERE IS BEGINNING OF TRIAL AND ERROR WITH THIS METHOD
    		    var $unorderedList = $('ul class="stylebox"');
    		    $element.append($unorderedList);
    		    console.log($unorderedList);
                for (var itemIndex in data) {
                    var $input = $('<input type="checkbox" name ="'+name+'" value="' + data[itemIndex].value + '">' + render(data[itemIndex]) + '</input>');
    
                    var $row = $('<li>');
                    $row.appendTo($unorderedList + '</li>');
    
                    $input.data(data[itemIndex]);
    				$input.appendTo($element + '</ul>');
                }
    
            });
        }
    
    
  4. In Topic: JavaScript - simple display div incominmessage on 2 lines instead of 1

    Posted 26 Nov 2014

    View PostMartyr2, on 26 November 2014 - 11:21 PM, said:

    You could just insert a <br> tag in there for each message. Simplest way...

    $('#order-message').html(breadMessage + '<br>');
    
    


    That or you can wrap each message in something like a span or div tag and apply a styling class to it.

    Up to you really. :)/>


    Sounds good!! Thank you very much!!! <br> Seems simple enouph!! lol
    Now hopefully you could help with my next question. Setting up bootstrap to use a messagebox :S lol
  5. In Topic: Validation / Time limit before certaintimeorder / online ordering site

    Posted 18 Nov 2014

    View PostArtificialSoldier, on 18 November 2014 - 10:18 AM, said:

    Do you have specific questions about things you're stuck on? About the dates, don't use Javascript to compare dates, use the server. Send the date selected to the server and send a response back whether or not the date is valid. If you use Javascript to compare dates then you comparing with the date/time and timezone settings on the user's computer. You should be checking against the server time instead.



    This project is going all client side so there will be no PHP involved. I suggested the same to my client saying about 10 A.M. ordering online is absurd but she agreed and continued with her choice..

    Here is some things i have tried for that so far. right now i have the current time Am or Pm and i have to set a default time of 10 am and compare them possibly with an if statement? right now when i try to set the time to 10 am it is in milliseconds with some HUGE number..

    function determineCutoffTime() {
    	    console.log("cut off time function");
    	    var msg = "To recieve an order the current day it must be played before 10 a.m. of that day.";
    	    //var timeNow = new Date($.now());
    	    //var dd = new Date.now();
    	   // console.log(dd);
    	    //get current time and date if before time accept otherwise show message and allow cancel
    
    	    //  jquery take 2
    	   // var jqueryTime = $.datepicker.formatDate('mm/dd/yy HH:mm:dd');
    	    // console.log(jqueryTime);
    	   // var jtime = new Date().getTime();
    	    //console.log(jtime);
    
    	    //alert($.datepicker.formatDate('yy/mm/dd', new Date()));
    	   // console.log("date now");
    	    //console.log($.now());
    	    //var myTime = $.now();
    	   // console.log(myTime);
    	    //console.log("dateNow()");
    	    //console.log(dateNow());
    	    //another try this time i will set date/time to 10 am
    	   // var buyingTime = new date();
    	   // buyingTime.setHours(10, 0, 0);
    	   // console.log(buyingTime);
    	   // console.log(new Date.today().toString());
    
    	    console.log('javascript');
    	    //javascript way
    	    var jsDate = new Date();
    	    var seconds = jsDate.getSeconds();
    	    var minutes = jsDate.getMinutes();
    	    var hours = jsDate.getHours();
    	    var day = jsDate.getDate();
    	    var month = jsDate.getMonth() + 1;
    	    var year = jsDate.getYear();
    	    //var jsTime = jsDate.getHours() + ":" + jsDate.getMinutes() + ":" + jsDate.getSeconds();//getMonth() getDate()   getFullYear()
    	    //var jsTime = hours:minutes:seconds month/day/year;
    	   // console.log(hours+":"+minutes+":"+seconds+" "+ month+"/"+day+"/"+year);
    
    	    //Get current Date and Time
    	    var today = new Date();
    	    var dd = today.getDate(); var mm = today.getMonth() + 1; var yyyy = today.getFullYear();
    	    var hh = today.getHours(); var min = today.getMinutes(); var sec = today.getSeconds();
    	    if (dd < 10) {
    	        dd = '0' + dd;
    	    }
    	    if (mm < 10) {
    	        mm = '0' + mm;
    	    }
    	    if (min < 10) {
    	        min = '0' + min;
    	    }
    	    today = hh + ":" + min + ":" + sec + " " + mm + "/" + dd + "/" + yyyy;
    	    console.log(today);
    
    	    /////////////////////////////////////////////
    	    var now = new Date();
            var nowhrs = now.getHours(); var nowmins = now.getMinutes(); var nowsecs = now.getSeconds();
            var determine = (nowhrs >= 12) ? " P.M." : " A.M.";
    
    	    if (nowhrs == 0) nowhrs = 12;	    
    	    var timeValue = "" + ((nowhrs > 12) ? nowhrs - 12 : nowhrs);
    	    timeValue += ((nowmins < 10) ? ":0"+nowmins : ":" + nowmins);
    	    timeValue += ((nowsecs < 10) ? ":0"+nowsecs : ":" + nowsecs);
    	    //timeValue += (nowhrs >= 12) ? " P.M." : " A.M.";
    	    timeValue += determine;
    	    console.log(timeValue);
    	    /////////////////////////////////
    	    //cutoff time
    	    var cutoffTime = new Date();
    	    var cutoffDay = cutoffTime.getDate();
    	    var cutoffMonth = cutoffTime.getMonth() + 1;
    	    var cutoffYear = cutoffTime.getFullYear();
    	    var cutoffHours = cutoffTime.setHours(10); var cutoffMins = cutoffTime.setMinutes(00); var cutoffSecs = cutoffTime.setSeconds(00); var cutoffDetermine = " A.M.";
    	    var cutoffTimeValue = cutoffHours + ":" + cutoffMins + ":" + cutoffSecs + cutoffDetermine;
    	    console.log(cutoffTimeValue);
    	}
    
    


    Also for validation to possibly stop the button from being clicked if there is no filling on the sub sandwich so you cant order a sub with just bread?
    I made a validation method and i wanted to return something like onClientClick but i believe that may not be javascript and only asp.net along with the onclick method of making the sub sandwich i want the validation to delay the onclick but still researching how to do that...

My Information

Member Title:
D.I.C Head
Age:
23 years old
Birthday:
January 24, 1991
Gender:
Location:
Wisconsin
Full Name:
Andrew
Years Programming:
1
Programming Languages:
Java
HTML
CSS
JavaScript
Little bit of PHP
C# currently learning

Contact Information

E-mail:
Click here to e-mail me

Friends

Exceedinglife hasn't added any friends yet.

Comments

Exceedinglife has no profile comments yet. Why not say hello?