By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,945 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,945 IT Pros & Developers. It's quick & easy.

problem with safari

P: 2
Problem description:
Clients working with an apple computer with the safari browser are experiencing problems with brokerage orders.
When the client wants to enter a stock order, the order entry screen displays 31-12-2005 as date.
When the client presses the OK button, it states that the entered date is wrong.
When the client changes the date to 31-12-2006, the application says the date is wrong.
If he uses the firefox browser he has no problems.

Expand|Select|Wrap|Line Numbers
  1. // createstockorder.js
  2. Onload.prototype.createstockorderbuttons = function createstockorderfunc() {
  3.     Buttons.add('okNewOrder', './imgs/ok_new_order.gif');
  4.     Buttons.add('okToPortfolio', './imgs/ok_to_portfolio.gif');
  5.     Buttons.add('okSend', './imgs/ok_send.gif');
  6.     Buttons.add('ignoreWarnings', './imgs/ignore_warnings.gif');
  7.     Buttons.setDefault('okSend');
  8.     // set focus
  9.     focusField(document.forms[0]);    
  10. }
  11.  
  12. function setFormOptions(form , maxContinuousDay, maxContinuousMonth, maxContinuousYear ) {
  13.     setDayOrder(form,true, maxContinuousDay, maxContinuousMonth, maxContinuousYear);
  14.     setIndicationLimit(form);
  15. }
  16. //modified for problem PR011707
  17. var maxContinuousDate;  // It is added for creating date for maximum allowed continuous untill value
  18. function setDayOrder(form, isOnLoad , maxContinuousDay, maxContinuousMonth, maxContinuousYear ) {
  19.     maxContinuousDate = new Date(maxContinuousYear,maxContinuousMonth -1,maxContinuousDay);
  20.     if (findElementById("indicationUntil").checked) {
  21.       // Default set to end of next month STBIB 1301 & FAT247    
  22.       enableField(form["periodDay"]);
  23.       enableField(form["periodMonth"]);
  24.       enableField(form["periodYear"]);
  25.       if(! isOnLoad && form["periodDay"].value == ""){
  26.           form["periodDay"].value = maxContinuousDay;
  27.           form["periodMonth"].value = maxContinuousMonth;
  28.           form["periodYear"].value =  maxContinuousYear;    
  29.       }  
  30.             form.periodDay.focus();
  31.      } else {
  32.        form["periodDay"].value = "";
  33.         form["periodMonth"].value = "";
  34.         form["periodYear"].value = "";    
  35.       disableField(form["periodDay"]);
  36.       disableField(form["periodMonth"]);
  37.       disableField(form["periodYear"]);
  38.      }
  39. }
  40.  
  41. function setIndicationLimit(form) {
  42.     if (findElementById("indicationLimited").checked ) {
  43.         enableField(form.limitRate);
  44.         enableField(form.limitDecimals);
  45.         form.limitRate.focus();
  46.     } else {
  47.         form["limitRate"].value = "";
  48.         form["limitDecimals"].value = "";
  49.         disableField(form.limitRate);
  50.         disableField(form.limitDecimals);         
  51.     }
  52. }
  53.  
  54. function checkForm(form) {            
  55.     var validator = new Validator();
  56.     validator.setErrorMessages(errors);    
  57.  
  58.     // First normalise some fields
  59.     if (findElementById("indicationLimited").checked) {
  60.         Helper.trimNumberLeft(form["limitRate"]);
  61.     }
  62.  
  63.       validator.addRule({
  64.           label: fields.indicationBuySell, 
  65.           fieldname: "indicationBuySell", 
  66.           required: true, 
  67.           include: ["BUY","SELL"],
  68.           value: Helper.createRadioValue(form["indicationBuySell"]),
  69.           errorMessages: {required:JSALERT_INDICATION_BUY_SELL_NOT_SELECTED}
  70.       });  
  71.  
  72.     validator.addRule({
  73.           label:fields.quantity, 
  74.           fieldname:"quantity",
  75.           format:"digits",
  76.           required:true,
  77.           minvalue:0,
  78.           exclude:0,
  79.           maxlength:6,
  80.           errorMessages: {
  81.               format:JSALERT_QUANTITY_INVALID,
  82.               required:JSALERT_QUANTITY_INVALID,
  83.               exclude:JSALERT_QUANTITY_INVALID,
  84.               minvalue:JSALERT_QUANTITY_INVALID
  85.           }
  86.       });    
  87.  
  88.       validator.addRule({
  89.           label: fields.indicationLimit, 
  90.           fieldname: "indicationLimit", 
  91.           required: true, 
  92.           include: ["BEST","LIMIT"],
  93.           value: Helper.createRadioValue(form["indicationLimit"]),
  94.           errorMessages: {required:JSALERT_INDICATION_LIMIT_NOT_SELECTED}
  95.       });      
  96.  
  97.       validator.addRule({
  98.           label:fields.limitRateInt, 
  99.           fieldname:"limitrate",
  100.           format:"limitrate",
  101.           required:true,
  102.           value: Helper.createLimitRate(form["limitRate"].value, form["limitDecimals"].value),
  103.           exclude: 0,
  104.           minvalue: 0,
  105.           when: (findElementById("indicationLimited").checked),
  106.           errorMessages: {
  107.              required:JSALERT_INDICATION_LIMIT_INVALID,
  108.               exclude:JSALERT_INDICATION_LIMIT_INVALID,
  109.               minvalue:JSALERT_INDICATION_LIMIT_INVALID,
  110.               format:JSALERT_INDICATION_LIMIT_INVALID
  111.           }
  112.       });
  113.  
  114.       validator.addRule({
  115.           label: fields.indicationDayOrder, 
  116.           fieldname:"indicationDayOrder", 
  117.           required:true, 
  118.           include:["DAY","CONTINUE"],
  119.           value:Helper.createRadioValue(form["indicationDayOrder"]),
  120.           errorMessages: {required:JSALERT_INDICATION_DAYORDER_NOT_SELECTED}
  121.       });
  122.  
  123.     var today = Helper.createDate(todayday, todaymonth, todayyear);        
  124.     //modified for problem PR011707
  125.     var valDate = Helper.createDate(maxContinuousDate.getDate(), (maxContinuousDate.getMonth() + 1), maxContinuousDate.getFullYear());    
  126.     var periodDate = Helper.createDate(form["periodDay"].value, form["periodMonth"].value, form["periodYear"].value);        
  127.  
  128.     // requireds and digits only 
  129.       validator.addRule({
  130.           label: fields.periodDate, 
  131.           fieldname:"periodDay",
  132.         required:true,
  133.         format: 'datedigits',
  134.           when: (findElementById("indicationUntil").checked),
  135.           errorMessages: {
  136.               required:JSALERT_PERIOD_REQUIRED,
  137.               format:JSALERT_PERIOD_NOT_NUMERIC
  138.           }
  139.       });    
  140.       validator.addRule({
  141.           label: fields.periodDate, 
  142.           fieldname:"periodMonth",
  143.         required:true,
  144.         format: 'datedigits',
  145.           when: (findElementById("indicationUntil").checked),
  146.           errorMessages: {
  147.               required:JSALERT_PERIOD_REQUIRED,
  148.               format:JSALERT_PERIOD_NOT_NUMERIC
  149.           }
  150.       });              
  151.       validator.addRule({
  152.           label: fields.periodDate, 
  153.           fieldname:"periodYear",
  154.         required:true,
  155.         minlength:4,
  156.         format: 'datedigits',
  157.           when: (findElementById("indicationUntil").checked),
  158.           errorMessages: {
  159.               required:JSALERT_PERIOD_REQUIRED,
  160.               minlength:JSALERT_PERIOD_INVALID,
  161.               format:JSALERT_PERIOD_NOT_NUMERIC
  162.           }
  163.       });                    
  164.     //modified for problem PR011707
  165.     // valid full date
  166.      validator.addRule({
  167.           label: fields.periodDate, 
  168.           fieldname:"periodDay",
  169.           format:'date',
  170.           value: periodDate,
  171.           exclude:today,
  172.           minvalue:today,
  173.           maxvalue:valDate,
  174.           when: (findElementById("indicationUntil").checked),
  175.           errorMessages: {
  176.               format:JSALERT_PERIOD_INVALID,
  177.               minvalue:JSALERT_PERIOD_TOO_EARLY, 
  178.               maxvalue:JSALERT_PERIOD_NOT_WITHIN_BOUNDS, 
  179.               exclude:JSALERT_PERIOD_IS_TODAY
  180.           }
  181.       }); 
  182.  
  183.     return validator.validate(form);
  184. }
Jan 23 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN!

So, which error message pops up?
Jan 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.