Jump to content

unplugged_web

Members
  • Posts

    897
  • Joined

  • Last visited

Posts posted by unplugged_web

  1. I've tried to changing this:

    public function getExpiryDate() {      $ops = $this->getRecurringOrderProducts();      $date = $this->getGoLiveDate();      $date->add(new DateInterval('P'.$ops[0]->getContractLength().'M'));    $date->sub(new DateInterval('P1D'));       return $date;    }

    to this:

        public function getExpiryDate() {        if($this->getRecurringOrderProducts()==-1) {      $date = $this->getGoLiveDate();}        if($this->getRecurringOrderProducts()==1) {      $ops = $this->getRecurringOrderProducts();      $date = $this->getGoLiveDate();      $date->add(new DateInterval('P'.$ops[0]->getContractLength().'M'));      $date->sub(new DateInterval('P1D'));      return $date;}    }

    but it then doesn't work and instead of working out the expiry date for recurring products it just has today's date rather than the date that should be being working out from this line

    $date->add(new DateInterval('P'.$ops[0]->getContractLength().'M'));      $date->sub(new DateInterval('P1D'));
  2. I'm trying to use this on a site built with Silex but whenever I try to change it it messes everything else up or doesn't work at all.

     

    I've attached the whole code

    {% extends "form_select2_new.twig" %}{% block extra_css_scripts %}  {{ parent() }}  <link href="/css/datepicker.css" rel="stylesheet" media="screen"><style>form > .form-group { clear:left }.form-group > .form-group { clear:left }.form-group > .form-group > .form-group { clear:none }.form-group > .form-group label,form > .form-group > .form-group > label {   display:block; }form > .form-group:nth-child(5) > .form-group:first-of-type .form-group label {  display:block;}form > .form-group > .form-group .form-group {  float:left;  width: 16.2%;}form > .form-group > .form-group .form-group.remove_product {  width: 2%;  text-align:right;  padding-top:30px;}form > .form-group:nth-child(5) > .form-group:first-of-type .remove_product {  padding-top:35px;}</style>{% endblock %}{% block extra_js_scripts %}  {{ parent() }}  <script src="/js/bootstrap-datepicker.js"></script>{% endblock %}{% block inline_script %}  {{ parent() }}  $('#order_order_date').attr('placeholder', 'dd/mm/yy').datepicker({format:'dd/mm/yy',weekStart:1});  var products = $('.form-group label:contains("Order products")').parent(),    add_product_button = ' <a href="#" id="add_product"><span class="glyphicon glyphicon-plus"></span> Add product</a>',    remove_product_button = '<div class="form-group remove_product"><a href="#" class="glyphicon glyphicon-remove"></a></div>';  products.children().first().append(add_product_button);  $('form').on('click', '#add_product', function(e) {    e.preventDefault();    var prototype = $('#new_product_form').data('prototype'),    index = $('form > .form-group > .form-group').length;    var new_product_form = $('<div class="form-group"></div>').append(prototype.replace(/__name__/g, index));    $( remove_product_button ).appendTo( new_product_form );    products.append(new_product_form);    $('select[id^="order_order_products_'+index+'"]').select2();  });  $('form').on('change', 'select[id$="product_id"]', function (e) {    var product_line = $(this).parent().parent(),      unit_price = $('input[id$="unit_price"]', product_line),      invoice_bill = $('select[id$="invoice_bill"]', product_line);    $.getJSON('/product/'+$(this).val(), function (json) {      unit_price.val(json.SalePrice);      invoice_bill.val(json.PriceType?'B':'I').change();      $('#order_bill_description').val( $('#order_bill_description').val()+"n"+json.BillDescription);      $('#order_notes').val( $('#order_notes').val()+"n"+json.InternalDescription);      $('#order_notes').val( $('#order_notes').val()+"n"+json.WholesalerName);    });  });  $('label:contains("Contract length")').parent().after(remove_product_button);  $('form').on('click', '.remove_product a', function(e) {    e.preventDefault();    $(this).parent().parent().remove();  });  $('#delivery_address_options').insertBefore('#order_delivery_address');  $('#delivery_address_options input:radio').on('change', function() {    var oda = $('#order_delivery_address'),     oda_value = oda.val();    if ($(this).val()=='c') {      $.getJSON('/customer/view/'+$('#order_customer_id').val(), function (data) {        var address = [data.Name, data.Address, data.City+' '+data.County, data.Postcode];        oda.val(oda_value+"n"+address.join("n"));      });    }    if ($(this).val()=='s') {      var site_id = $('#order_customer_site_id').val();      if(site_id) {        $.getJSON('/customer_site/view/'+site_id, function (data) {          var address = [data.Name, data.Address, data.City+' '+data.County, data.Postcode];          oda.val(oda_value+"n"+address.join("n"));        });      } else if(site_id==-1) {        oda.val($('#order_customer_site_address').val()+"n"+$('#order_customer_site_city').val()+"n"+$('#order_customer_site_postcode').val());      }    }  });  $('#order_customer_site_name, #order_customer_site_address, #order_customer_site_city, #order_customer_site_postcode').parent().hide();  $('#order_customer_site_id').on('change', function(e) {    e.preventDefault();    if($(this).val()==-1) {      $('#order_customer_site_name, #order_customer_site_address, #order_customer_site_city, #order_customer_site_postcode').parent().show();    } else {      $('#order_customer_site_name, #order_customer_site_address, #order_customer_site_city, #order_customer_site_postcode').parent().hide();    }  });  $('#order_customer_contact_name, #order_customer_contact_email').parent().hide();  $('#order_customer_contact_id').on('change', function(e) {    e.preventDefault();    if($(this).val()==-1) {      $('#order_customer_contact_name, #order_customer_contact_email').parent().show();    } else {      $('#order_customer_contact_name, #order_customer_contact_email').parent().hide();    }  });  $('#order_delivery_option_box').insertBefore('#order_delivery_price');  function updateText(src){	if(src.checked)		document.getElementById('order_delivery_price').value = src.value;}{% endblock %}{% block body %}  <div id="new_product_form" data-prototype="{{ form_widget(form.order_products.vars.prototype)|e }}"></div>  {{ parent() }}  <div id="delivery_address_options">    <label class="radio-inline"> <input type="radio" name="delivery_address_option" value="c" id="dao_customer">Customer </label>    <label class="radio-inline"> <input type="radio" name="delivery_address_option" value="s" id="dao_customer_site">Customer Site</label>    <label class="radio-inline"> <input type="radio" name="delivery_address_option" value="0" id="dao_custom">Custom </label>  </div>  <div id="order_delivery_option_box">  <label class="radio-inline"> <input type="radio" name="delivery_price_option" value="15.00" id="dpo_pre" onClick='updateText(this);'>Pre 12</label>    <label class="radio-inline"> <input type="radio" name="delivery_price_option" value="8.00" id="dpo_next">Next Day</label>    <label class="radio-inline"> <input type="radio" name="delivery_price_option" value=" " id="dpo_custom">Custom </label></select></div>{% endblock %}
  3. I'm working on a site that generates a certificate (a pdf file) when somebody places an order. There are two types of products that can be ordered, one is a one off product the other has a recurring fee for 12 months, 24 months or 36 months.

    If somebody orders a products with a recurring fee then the pdf file is generated no problems. But if the product is a one off product then the pdf isn't generated.

    I've been throughout the error log and it says:

    PHP Notice: Undefined offset: 0 in /home/ubuntu/web/generated-classes/site/Order.php on line 189

    and

     

    PHP Fatal error: Call to a member function getContractLength() on a non-object in /home/ubuntu/web/generated-classes/site/Order.php on line 189

    Line 189 is:

          $date->add(new DateInterval('P'.$ops[0]->getContractLength().'M'));

    with the whole function being:

    public function getExpiryDate() {      $ops = $this->getRecurringOrderProducts();      $date = $this->getGoLiveDate();      $date->add(new DateInterval('P'.$ops[0]->getContractLength().'M'));      $date->sub(new DateInterval('P1D'));       return $date;    }     public function getDeliveryOptionValue()    {      return self::$delivery_options[ $this->getDeliveryOption() ];    }   public function getRecurringOrderProducts()  {    $products = array();    foreach($this->getOrderProducts() as $op) {      if($op->getProduct()->isRecurring()) {        $products[] = $op;      }    }     return $products;  }

    What I don't know how to do those is change the code so that if the product is a one off then skips that part and just sets the ExpiryDate as never.

    I'd be grateful for any help with this. By the way I didn't build the site but its written with Silex (something I've never used before)

    Thank you

  4. I assume u have a listbox with select options made with that array ( with a loop)?

    static public $time_day = array(1=>"Morning", 2=>"Afternoon", 0=>"custom");

    Would give you an array like

     

    where 1 is the key and the word is the value. But if you need to show a day based of the int but you need the int value as well.Use multidimensional array.

    static public $time_day = array(                                0=> array ("daytime" => "custom", "time" => 6),                                1=> array ("daytime" => "Morning", "time" => 12),                                2=> array ("daytime" => "Afternoon", "time" => 2)                          );

    Then you can populate the list with name as the

    $time_day[0]["daytime"],$time_day[1]["daytime"],$time_day[2]["daytime"]

    and value as

    ​ $time_day[0]["time"],$time_day[1]["time"],$time_day[2]["time"]

    And then use the value with javascript as a value for the 2nd textbox or what ever it is.

    I did try that, but ended up with an error say:

     

     

     

    InvalidOptionsException: The options "0", "1" do not exist. Known options are: "action", "attr", "auto_initialize", "block_name", "by_reference", "cascade_validation", "choice_list", "choices", "compound", "constraints", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_provider", "data", "data_class", "disabled", "empty_data", "empty_value", "error_bubbling", "error_mapping", "expanded", "extra_fields_message", "inherit_data", "intention", "invalid_message", "invalid_message_parameters", "label", "label_attr", "mapped", "max_length", "method", "multiple", "pattern", "post_max_size_message", "preferred_choices", "property_path", "read_only", "required", "translation_domain", "trim", "validation_groups", "virtual"
  5. I've got a website I'm working on that has a field that I want to populate depending on the results of another field. So if somebody selects Morning the it auto fills the next box with 6, if they select Afternoon it auto fills 12 and if they select custom then they can fill in whatever they want.

    At the moment I've got the first field populated like this:

          ->add('day', 'choice', array(        'choices' => Order::$time_day,      ))      ->add('period');

    and the array is:

    static public $time_day = array(1=>"Morning", 2=>"Afternoon", 0=>"custom");

    The time_day is stored int he database as 1, 2 or 0 so I can't change that, but I tried changing it to this:

          ->add('day', 'choice', array(        'choices' => Order::$time_day,      ))      ->add('period', 'textarea', array(        'choices' => Order::$day_period,      ));

    with the array being:

    static public $time_day = array(1=>"Morning", 2=>"Afternoon", 0=>"Night");$day_period = array(1=>"6", 2=>"12", 0=>"");

    but it didn't work

  6. I've got a form that requires people to upload a photo of themselves. I'm using this to get the photo:

    <input type="file" name="photo" id="photo" />

    and this to validate it but it's still allowing people to send the form without a photo. All of the other validation works it's just the photo part.

    <script type="text/javascript">   function validate_form(){        var f = document.getElementById('fname');        var l = document.getElementById('lname');        var e = document.getElementById('email');        var p = document.getElementById('phone');        var ph = document.getElementById('photo');        var fAlert = "Please enter your first name";        var lAlert = "Please enter your last name";        var eAlert = "Please enter a valid email address";        var pAlert = "Please enter a contact number";        var phAlert = "Please provide a recent photo";        var em;         if (!f.value) {                 alert (fAlert);                 return false;         }         if (!l.value) {                 alert (lAlert);                 return false;         }         if (!e.value) {                 alert (eAlert);                 return false;         }         em = e.value.match(/[@.]/g);         if ((!em) || (em.length < 2)) {                 alert (eAlert);                 return false;         }         if (!p.value) {               alert (pAlert);               return false;         }         if (!ph.value) {                 alert (phAlert);                 return false;         }         return true;   }   </script>

    Thanks

  7. Sorry I think I made a mistake in the original post, the target needs to be like this:

     

    $target = '/home/linweb22/f/domain.com/user/htdocs/new/designers/images/designer/' . basename( $_FILES['photo']['name']);

     

    I've tried doing it like this but it doesn't work:

     

    $target = '/home/linweb22/f/domain.com/user/htdocs/new/designers/images/$designer/' . basename( $_FILES['photo']['name']);

  8. I'm trying to get a file to upload to a folder depending on which is different depending on what option the user has selected. The folder name is sent in the $designer variable but I'm not sure how to add it to code I've got.

    $pic  = $_FILES['photo']['name'];$target = '/home/linweb22/f/domain.com/user/htdocs/new/designers/images/' . basename( $_FILES['photo']['name']);$temp_name = $_FILES['photo']['tmp_name'];$type = $_FILES["photo"]["type"];

    I tried adding it to the target line so that it was like this:

    $target = '/home/linweb22/f/domain.com/user/htdocs/new/designers/images/$designer/' . basename( $_FILES['photo']['name']);

    But all I got was an error saying that the folder wasn't there. If I try adding it without the $designer variable then it submits okay but I do need it to be in a different folder depending on the option selected.

    Thanks

  9. I've recently been asked to build a shop website that people can purchase through. Originally the client was happy with just PayPal but now they've said they want to have the ability to pay direct by credit card. I've never done anything like this and don't know how to do so. How would I go about doing this?

     

    Thanks

  10. obj is only defined in the callback function for the ajax request, it's not global. But by default most browsers will not allow ajax requests to another domain, I don't know why it would work in any browser unless you changed the settings. If you need to load content from another domain then you need to use another solution, like a PHP proxy (send an ajax request to a PHP page on your server, PHP loads the remote content, and returns the result).
    I've been able to get the js file to be uploaded the to same domain as that the request is coming from, but it's still not working. If I save the results as a json file and test it on the same server as the site it works, but if I change where the results are coming from and then upload it all to the same server it still doesn't work. When I try this the only line that changes is this one:
            call("https://www.domain.com/passkey", { JL: 0 },

  11. I have a url (on a separate server with a different domain name) that gives me various parameters I need. I've managed to get the results, but for some reason it doesn't show any results at all in IE and I'm not sure why. It works in every other browser, but just not IE. I've checked the console and there's no errors at all, I've also used jslint.com to check the js code and that's all fine too. While I'm testing this I've removed everything else in the file so that there's nothing that can conflict with it. This is what I'm using to get the results. I have a separate js file that contains this:

    /*jshint -W061 */function call(url, parameters, callback) {	"use strict";	$.ajax({		type: 'POST',		url: url,		data: parameters,		success: function(data) {			callback(data);		},  cache: false	}		);} function loadJackpots() {	"use strict";	call("https://www.domain.com/passkey", { JL: 0 },		function(data) {			var divIdentifier, obj = eval('(' + data + ')');			$.each(obj.JL, function() { 				divIdentifier = "";				switch (this.gameID) {				case 2:					divIdentifier = "#snap";					break;				case 5:					divIdentifier = "#dominos";					break;				case 1000:					divIdentifier = "#chess1";					break;				case 1001:					divIdentifier = "#chess2";					break;				case 1002:					divIdentifier = "#chess3";					break;				} 				if (this.gameID >= 1000) {					switch (this.stakeID) {					case 4:						divIdentifier += "_50c";						break;					case 5:						divIdentifier += "_1d";						break;					case 7:						divIdentifier += "_2d";						break;					case 9:						divIdentifier += "_2d";						break;					}				} 				if (this.gameID === 1000) {					switch (this.subID) {					case 0:						divIdentifier += "_1";						break;					case 1:						divIdentifier += "_2";						break;					case 2:						divIdentifier += "_3";						break;					}				}				$(divIdentifier).html("$" + this.jackpot);			});		}		 );}

    I use this to actually load the values:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script><script type="text/javascript">		 $(function() {			loadJackpots();		});				</script>

    And to display the results I'm using this:

    <div id="chess1"><div id="chess1_50c">$1466.85</div><div id="chess1_1d">$1641.11</div><div id="chess1_2d">$378.04</div></div>  <div id="chess3"><div id="chess3_50c">$303.86</div><div id="chess3_1d">$523.02</div><div id="chess3_2d">$1473.72</div></div> </div><div style="float: left; margin: 194px 0 0 185px;"><div id="chess2_1"><div id="chess2_50c_1">$195.26</div><div id="chess2_1d_1">$154.37</div><div id="chess2_2d_1">$193.76</div></div><div id="chess2_2"><div id="chess2_50c_2">$146.84</div><div id="chess2_1d_2">$119.58</div><div id="chess2_2d_2">$145.86</div></div><div id="chess2_3"><div id="chess2_50c_3">$2.96</div><div id="chess2_1d_3">$19.25</div><div id="chess2_2d_3">$121.89</div></div> </div></div><div style="height: 80px;"><div id="snap"><div id="snap_jp">$862.16</div></div>  <div id="dominos"><div id="dominos_jp">$2823.18</div></div>

    I've also tried this but to no avail, it just gave me an error saying obj is undefined:

    <div id="dominos"><div id="dominos_jp">$2823.18</div><script language="javascript">document.getElementById("dominos_jp").HTML=obj.JL[1].jackpot</script></div>

    I'd be really grateful for any help with this as I've tried everything to get it sorted, but no matter what I do it just won't work in IE. I read something about Ajax doesn't allow cross domain requests but I don't know how to rectify this - the values come from a url that is on another domain and I can't change that.

  12. I don't get any console errors at all and have now removed all references to document.write but it still isn't showing anything.This is now what I've got to display the results. Again it works in all browsers except for IE and there's no errors at all.

     <div style="float: right; margin: 2px 149px 0 0;"><div id="Jo"><div id="Jo_0"></div><div id="Jo_2"></div><div id="Jo_3"></div></div> <div class="clear"></div> <div id="Fred"><div id="Fred_0"></div><div id="Fred_1"></div><div id="Fred_2"></div></div> <div class="clear"></div></div><div style="float: left; margin: 194px 0 0 185px;"><div id="Sue"><div id="Sue_0_1h"></div><div id="Sue_0_2h"></div><div id="Sue_0_3h"></div></div> <div id="Sue"><div id="Sue_1_1h"></div><div id="Sue_1_2h"></div><div id="Sue_1_3h"></div></div> <div id="Sue"><div id="Sue_3_1h"></div><div id="Sue_3_2h"></div><div id="Sue_3_3h"></div></div> <div class="clear"></div></div></div><div style="height: 80px;"> <div id="Chris_0"><div id="Chris"></div></div> <div class="clear"></div> <div id="John_0"><div id="John"></div></div> <div class="clear"></div></div>

  13. I've managed to get the results, but for some reason it doesn't show any results at all in IE and I'm not sure why. It works in every other browser, but just not IE. :( This is what I'm using to get the results. The <head> section had this:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"> </script><script src="js/users.js" type="text/javascript"></script> <script type="text/javascript">         var imagesURL = localSt.iUrl();         function call(url, parameters, callback) {            var localTimeout = 10000;            $("#loader").show();            $.ajax({                type: 'POST',                url: url,                data: parameters,                timeout: localTimeout,                success: function(data) {                    $("#loader").hide();                    var obj = eval('(' + data + ')');                    if (obj.ER) {                         var header = "";                        var msg = "Sorry there seems to be a communication error (" + obj.ER + ").<br/>Please log in again.";                        //Error detail may be in PU                        if (obj.ER == "103") {                            header = obj.PU.HD;                            msg = obj.PU.BD;                        } else if (obj.ER == "1007") {                            //authentcation failed                                                     header = obj.PU.HD;                            msg = obj.PU.BD;                        }                         $(this).attr("disabled", false);                         showMessage(header, msg);                     } else {                        if (obj.PU) {                            var msg = "";                            var header = ""                            if (obj.PU.HD) {                                header = obj.PU.HD;                            }                            showMessage(header, obj.PU.BD, function() {                                callback(data);                            });                        } else {                            callback(data);                        }                    }                }            });        }         function loadtotals() {             call("https://my.domain.com/server/passkey.ashx", { JL: 0 },   function(data) {        var divIdentifier;       var obj = eval('(' + data + ')');        $.each(obj.JL, function() {            divIdentifier = "";           //keys: userID,currentID,lifetimeID,total           switch (this.userID) {               case 2:                   divIdentifier = "#Jo";                   break;               case 5:                   divIdentifier = "#Fred";                   break;               case 1000:                   divIdentifier = "#Sue";                   break;               case 1001:                   divIdentifier = "#Chris";                   break;               case 1002:                   divIdentifier = "#John";                   break;           }            if (this.userID >= 1000) {               switch (this.lifetimeID) {                   case 4:                       divIdentifier += "_0";                       break;                   case 5:                       divIdentifier += "_2";                       break;                   case 7: case 9:                       divIdentifier += "_3";                       break;               }           }            if (this.userID == 1000) {               switch (this.currentID) {                   case 0:                       divIdentifier += "_1h";                       break;                   case 1:                       divIdentifier += "_2h";                       break;                   case 2:                       divIdentifier += "_3h";                       break;               }           }           $(divIdentifier).html("£" + this.total);       });   }   );        }         function showApp() {            $("#loader").hide();                  }         $(document).ready(function() {            if (navigator.userAgent.match(/Android/i)) {                $("body").addClass("android");            }            if (navigator.userAgent.indexOf("iPhone OS") > -1) {                if (navigator.userAgent.indexOf("Version/5.1") > -1) {                    $("body").addClass("iphone4");                }                $("body").addClass("iphone");            }            $("a").click(function(event) {                event.preventDefault();                parent.$("#newuserID").val(0);                window.location = $(this).attr("href");            });             loadtotals();            showApp();        });                </script>

    And within the <body> section I'm displaying the results by using this:

    <div style="float: right; margin: 2px 149px 0 0;"><script type="text/javascript">document.write('<div id="Jo">');</script><div id="Jo_0"></div><div id="Jo_2"></div><div id="Jo_3"></div></div>  <div class="clear"></div> <script type="text/javascript">document.write('<div id="Fred">');</script><div id="Fred_0"></div><div id="Fred_1"></div><div id="Fred_2"></div></div> <div class="clear"></div> </div><div style="float: left; margin: 194px 0 0 185px;"><script type="text/javascript">document.write('<div id="Sue">');</script><div id="Sue_0_1h"></div><div id="Sue_0_2h"></div><div id="Sue_0_3h"></div></div><script type="text/javascript">document.write('<div id="Sue">');</script><div id="Sue_1_1h"></div><div id="Sue_1_2h"></div><div id="Sue_1_3h"></div></div><script type="text/javascript">document.write('<div id="Sue">');</script><div id="Sue_3_1h"></div><div id="Sue_3_2h"></div><div id="Sue_3_3h"></div></div> <div class="clear"></div> </div></div><div style="height: 80px;"><script type="text/javascript">document.write('<div id="Chris_0">');</script><div id="Chris"></div></div> <div class="clear"></div>  <script type="text/javascript">document.write('<div id="John_0">');</script><div id="John"></div></div> <div class="clear"></div></div> 

  14. If that page is on a different domain then you can't use Javascript to get it at all, ajax does not work to get content on a different domain. Maybe you could create an invisible iframe and load the document into that iframe, then get the contents of it with Javascript, but that might also be restricted if it's on a different domain.
    Is it possible then to get the results into a database? I can then get just the results I need if everything is stored in it's own field?
  15. its quite literally trying to split the url:https://www.domain.c...word/users.aspx not what is returned from the page users.aspx
    Sorry I don't understand? I couldn't post the real url because it contains the password to get the details, but when I got to the url it prints this:
    var currents="[Jo,0,1250.21][ian,0.10,2578.30][Fred,2.00,249.25][sue,0.30,1157.56][Chris,0.60,0.15][John,3.00,4742.60][Carl,0.50,0.00][Amanda,0.50,1356.89][Zoe,0.50,549.28][Jo,0.50,0.00][Jen,0.50,0.00][Jo,1.00,288.27][Tracey,1.00,1499.20][Colin,1.00,0.00][simon,1.00,0.00][William,1.00,0.00][Ty,5.00,4872.86][Red,2.00,249.27][ian,2.00,1023.41][Jeff,2.00,0.00][Kevin,2.00,0.00][Carol,2.00,0.00]";function currentValues() {$("#currentinfo").html(currents);}
  16. Thanks I tried that, but it didn't work. I've now got this:

    <script>window.onload = function() {document.getElementById('out').innerHTML = '';process();}var currents=window.location.href.toString('https://www.domain.com/password/users.aspx')function process() {var clean = currents.replace(/\[/g,'');var arr = clean.split(']');for (var i=0 ; i<arr.length-1 ; i++) {var temp = arr[i].split(',');document.getElementById('out').innerHTML += '<span class="hdr">Name:</span> '+ temp[0];document.getElementById('out').innerHTML += ' <span class="hdr">Initial Value:</span> '+ temp[1];document.getElementById('out').innerHTML += ' <span class="hdr">Total Value:</span> '+ temp[2] +'<br/>';}}</script>

    Then within the actual page I've got:

    <div id="out"></div>

    but it doesn't show anything at all. I tried putting some random text in the 'out' div to make sure it was showing and it was but it's not showing the values.

×
×
  • Create New...