- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
I am trying to get the add button to enable if I select a valid file otherwise disable it. Also i'm trying to show messages if an invalid file is selected. The code below doesn't not seem to generate the desired result: <form name="myForm"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add … |
|
Employee.php <div class="col-xs-12"> <h2>Listing Employee</h2> <hr> <div class="employeeGrid"> <table> <tr> <th><a href="" ng-click="orderByField='name'; reverseSort = !reverseSort">Name</a></th> <th><a href="" ng-click="orderByField='age'; reverseSort = !reverseSort">Age</a></th> <th><a href="" ng-click="orderByField='gender'; reverseSort = !reverseSort">Gender</a></th> <th><a href="" ng-click="orderByField='company'; reverseSort = !reverseSort">Company</a></th> <th>Action</th> </tr> <tr ng-repeat="person in employee | orderBy:orderByField:reverseSort""> <td>{{person.name}}</td> <td>{{person.age}}</td> <td>{{person.gender}}</td> <td>{{person.company}}</td> <td> <button class="btn" ng-click="viewEmployee(person.id)"><span … |
|
The code below opens a modal window successfully. When I attempt to open the modal window after closing it, my browser window freezes. To unfreeze I press the escape button on my keyboard. Employee.php <div class="modal-footer"> <button type="button" class="btn btn-secondary" ng-click="closeEmployee()" data-dismiss="modal">Close</button> </div> EmployeeModalController.js <div class="modal-footer"> <button type="button" class="btn btn-secondary" … |
|
I am attempting to create a simple project for the subject matter for learning and discovery purpose however it doesn't seem to work. My rest API works well but the integration of AngularJS with Laravel doesn't work. You can pull my mini project from [Click Here](https://github.com/solomon13000/angulara). Your help is kindly … |
|
I am attemping to calculate the cost by issuing the query below however it always return no value: //Re-calculate the cost price $f15 = "SELECT sum(cost) FROM ingredients WHERE item_id_fk = :targetID"; $e16 = $this->l1->prepare($f15); $e16->bindParam(':targetID', $g4); $e16->execute(); $g5 = $e16->fetch(PDO::FETCH_NUM); error_log(print_r($g5[0], TRUE)); Did I miss out something? Your help … |
|
I am attempting to create a responsive website. On my left hand side I have a jpeg image and on the right hand side there is a box with text description. However when I view the website on a smaller screen device it is not resizing properly especially the image. … |
|
The following html consists of two section, the left and the right. The problem I am facing is when I view on tablet or other mobile device the image (dimension 562 x 330) on the left does not scale consistently with the information box on the right. I attempted to … |
|
The code below works well on all browser except for IE 8. So I added the respond.js script however it is not responsive in IE 8. Did I missed out something? <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>index</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> … |
|
I can't seem to make my menu work. **test.htm** <html> <head><head> <link rel="stylesheet" href="slicknav.css" /> <script src="jquery-1.11.1.min.js"></script> <script src="jquery.slicknav.js"></script> <script src="initialize.js"></script> <title></title> <body> <ul id="menu2"> <li>Parent 1 <ul> <li><a href="#">item 3</a></li> <li>Parent 3 <ul> <li><a href="#">item 8</a></li> <li><a href="#">item 9</a></li> <li><a href="#">item 10</a></li> </ul> </li> <li><a href="#">item 4</a></li> </ul> </li> … |
|
The code below ensures that my entry is only numeric with 2 decimal. <input type="text" maxlength="10" name="numPrice" value="1.00"> $("input[name='numPrice']").keyup(function(){ if(!(/^\d+(\.{0,1}\d{0,2})?$/.test(this.value)) ){ this.value = this.value.substring(0, this.value.length - 1); } return this; }); However values such as 1&.0 is not rejected by the code above. Did I miss something? |
|
I attempted to access the code below using safari browser but the input mask accepts any value which is wrong. <html> <head></head> <script src="C:/Users/marieeugene/Desktop/inputmask/jquery-1.11.1.min.js" type="text/javascript"></script> <script src="C:/Users/marieeugene/Desktop/inputmask/jquery.inputmask.bundle.js" type="text/javascript"></script> <script> $(document).ready(function(){ $(":input").inputmask(); }); </script> <body> <input data-inputmask="'alias': 'numeric', 'groupSeparator': ',', 'autoGroup': true, 'digits': 4, 'digitsOptional': false, 'prefix': '$ ', 'placeholder': '0'" … |
|
The following SQL query would return 1 record with a min(unit_cm): select id, name, category, min(unit_cm), unit_Cost, unit_price, unit_costPerc from ( SELECT a.id, b.name, e.name as 'category', (d.unit_price - d.unit_cost) as 'unit_cm', d.unit_cost, d.unit_price, ((d.unit_cost/d.unit_price)*100) as 'unit_costPerc' FROM menu_items a, item b, menu c, price d, categories e where a.item_id_fk … |
|
I am attempting to organize my code in the following manner: if (is_ajax()) { if (isset($_POST["action"]) && !empty($_POST["action"])) { //Checks if action value exists $action = $_POST["action"]; switch($action) { //Switch case for value of action case "initMsg": initMsg_function(); break; case "initCombo": initCombo_function(); break; } } } function is_ajax() { return … |
|
When I access call.php the variable name 'json' is not accessible to param.js as below: init.js $("document").ready(function(){ var data = { "action": "init" }; data = $(this).serialize() + "&" + $.param(data); var json; $.ajax({ type: "POST", dataType: "json", url: "response.php", //Relative or absolute path to response.php file data: data, success: … |
|
I have this codes in a php file (init_js.php): <script> <?php $idx = $_GET['id']; $APP_WEB_PATH = APP_WEB_PATH; ?> var idx = '<?=$idx?>'; var APP_WEB_PATH = '<?=$APP_WEB_PATH?>'; </script> Then I import this file to a php page (branch.php). When I view source I can see var idx = '7'; var APP_WEB_PATH … |
|
The following codes can be found in my javascript file (code.js): function addBranch(path, id){ //Click "Cancel" button return to Restaurant Manager Page $("input[name=btCancel]").click(function(){ window.location.href = path + '/branch_manager.php?id=' + id }); } The following codes can be found in my php file (test.php): <script src="<?php echo APP_WEB_PATH; ?>/js/jquery-1.11.1.min.js" type="text/javascript"></script> <script … |
|
I am getting an error for the line of code included in a js file. $(document).ready(function(){ //Click "Cancel" button return to Restaurant Manager Page $("input[name=btCancel]").click(function(){ window.location.href = "<?php echo APP_WEB_PATH,"/branch_manager.php?id=".$_GET['id'];?>"; }); }); The uncaught exception points to window.location.href = "<?php echo APP_WEB_PATH,"/branch_manager.php?id=".$_GET['id'];?>"; Is it because I cannot mix JavaScript with … |
|
I have two modules built by two developers: 1) backoffice 2) reporting However they share a single connection. The problem now is the security aspect. Both modules are independent in their respective folder(s) but they share the same connection. A developer mention that with the current architecture it is impossible … |
|
I notice that my PHP code contain special numbers (e.g. _5b9652a96785) representing variables: <?php include_once('../include/config.php');include_once('../class/db.php');if (isset($_POST["points"])) {$_5420457f97cc = json_decode(stripslashes($_POST["points"]), true);$_a095ff903bcc = trim($_5420457f97cc["itemName"]);$_58f60403479c = trim($_5420457f97cc["itemCost"]);$_bb2bde3e818f = trim($_5420457f97cc["itemPrice"]);$_5b9652a96785 = $_5420457f97cc["itemUnit"];$_03d9de238649 = $_5420457f97cc["itemCategory"];$_22f632d073d5 = $_5420457f97cc["ingredientArray"];$_83647d4cbbd0 = new dbPdoMysql;$_6445f036fed3 = $_83647d4cbbd0->dbInsertItem($_a095ff903bcc,$_5b9652a96785,$_03d9de238649,$_58f60403479c,$_bb2bde3e818f, $_22f632d073d5);if ($_6445f036fed3 == true){echo "true";}else{echo "false";}}else{}?> What does the special numbers mean and … |
|
I intend to integrate single sign on (facebook login) to my php website. However I intend to do so without installing the SDK into my 3rd party web server. What is the best way to achieve this?. |
|
I would like to enquire further details about the terms of using php for commercial application development. The scenario is that I have built an application using PHP and intend to host it with a 3rd party hosting company. I am renting the server at the hosting company and the … |
|
Instead of using synchronization, I used AtomicReference as a substitute: private AtomicReference<HashMap<String,String>> a = new AtomicReference<HashMap<String,String>>(); public String initPool(HashMap<String,String> latest){ HashMap<String, String> old = a.get(); if(old!=null){ Set<String> key = a.get().keySet(); for(String val: key){ if(!latest.containsKey(val)){ a.get().put(val,latest.get(val)); return returnObj(val); }else{ return returnObj(val); } } }else{ a.compareAndSet(old, latest); return null; } return null; … |
|
The line appears as a red line in google chrome for the below tag: <hr width="1052" style="border: 1px solid #990000" color="#990000" size="1"> However when I view in IE it appears as a box with white filling but red border line. Did I miss something? Your help is kindly appreciated. Thank … |
|
I tend to receive the following error message when I view the site in IE 9: HTML1524: Invalid DOCTYPE. The shortest valid doctype is "<!DOCTYPE html>". activate.html, line 1 character 1 SEC7113: CSS was ignored due to mime type mismatch style.css I include herewith the html code: <!DOCTYPE html PUBLIC … |
|
I have a form to submit the details as below: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Activate</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1"> </script> <script type="text/javascript" src="js/activate.js"> </script> </head> <body> <form method="post" name="form"> <table style="text-align: left; width: 789px; height: 715px;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="width: 305px;"> … |
|
I attempted to implement image rotation using google jquery library. The problem is that the image rotation stops at 5.jpg and doesn't go back to 1.jpg to 2.jpg.........and so on. Did I miss out something? <html> <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=3.0.1"> </script> <script type="text/javascript" src="js/img-rotator.js"> </script> <link rel="stylesheet" href="css/style.css" type="text/css" … |
|
I am a Java developer but out of curiousity I would like to find out why is it not necessary for a method to declare an exception when coding in C++? So does it make C++ a weaker language since it enforces a weaker rule? |
|
I found some reading materials about factory design pattern (parallel hierarchy) whereby a class in a hierarchy has a corresponding class in the another hierarchy. So I wrote the code as below: package com.factory3; public abstract class Subject { abstract SubjectPlanner createPlanner(); } package com.factory3; public class English extends Subject{ … |
|
I wrote a code to represent the factory design pattern as below: package com.factory2; public interface CreditCheck { Double creditLimit(int id); } package com.factory2; public class CreditCheckFactory { public boolean isAgencyUp(){ return true; } public CreditCheck createCreditCheck(){ if(isAgencyUp()){ return new CreditCheckOnline(); }else{ return new CreditCheckOffline(); } } } package com.factory2; … |
|
I wanted to verify is this a good example of a flyweight design pattern: package com.flyweight; public interface Chemical { String getName(); String getSymbol(); Double getAtomicWeight(); } package com.flyweight; import java.util.HashMap; import java.util.Map; public class ChemicalFactory { private static Map chemicals = new HashMap(); private static ChemicalFactory factory = new … |