This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="oth" id="oth"> | |
<option value="">Please Select</option> | |
<option value="1">1</option> | |
<option value="2">2</option> | |
</select> | |
<input type="text" id="output" style="display: none"/> | |
$(document).ready(function(){ | |
$("#oth").change(function() { | |
$(this).val() == "2" ? $('#output').show() : $('#output').hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.msgBox({ | |
title: "Successfull !", | |
content: "Your job posting is being processed", | |
type: "right" | |
}); | |
window.setTimeout(function () { | |
location.href = "index.php"; | |
}, 3500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<SCRIPT language="javascript"> | |
$(document).ready(function() { | |
$("#check").change(function() { | |
var d = $(this).val(); | |
if(d == 'parent'){ | |
$(".child").prop("checked", !d.checked); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<SCRIPT language="javascript"> | |
$(document).ready(function() { | |
//delete | |
$("#deletemessage").click(function() { | |
}); | |
//check in database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//expected output | |
Current Date | +1 month | |
----------------------------------------------------- | |
2015-01-01 | 2015-02-01 (+31 days) | |
2015-01-15 | 2015-02-15 (+31 days) | |
2015-01-30 | 2015-03-02 (+31 days, skips Feb) | |
2015-01-31 | 2015-03-03 (+31 days, skips Feb) | |
2015-02-15 | 2015-03-15 (+28 days) | |
2015-03-31 | 2015-05-01 (+31 days, skips April) | |
2015-12-31 | 2016-01-31 (+31 days) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#ic1,#ic2,#ic3').keyup(function(){ | |
/*get value from form*/ | |
var dob = $('#ic1').val(); // eg: 850510 - 10/05/1985 | |
var code = $('#ic2').val(); // eg: 14 - Wilayah Persekutuan | |
var icno = $('#ic3').val(); // eg: 0000 - ic number | |
//check gender using ic number | |
if (icno % 2 == 0){ | |
$('#gender_F').prop("checked", true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//html | |
<div id="imagepicture"><i id="fafaimage" class="fa fa-picture-o" aria-hidden="true"></i></div> | |
<input type="file" accept="image/*" name="image_upload_file" id="image_upload_file" required/> | |
//js | |
function filePreview(input) { | |
if (input.files && input.files[0]) { | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
$('#imagepicture + img').remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//HTML | |
<p id="error1" style="display:none; color:#FF0000;"> | |
Invalid Image Format! Image Format Must Be JPG, JPEG, PNG or GIF. | |
</p> | |
<p id="error2" style="display:none; color:#FF0000;"> | |
Maximum File Size Limit is 4MB. | |
</p> | |
<p> | |
<input type="file" accept="image/*" name="image_upload_file" id="image_upload_file" required/> | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from php | |
$date1 = date_create('2017-10-10'); | |
$date2 = date_create('2017-10-15'); | |
$diff = date_diff($date1,$date2); | |
echo $diff->format("%R%a days"); // +14 days - %R is +/- | %a is number | |
//from database to php | |
$y = date('Y', strtotime($desc['gep_startdate'])); | |
$m = date('n', strtotime($desc['gep_startdate'])); | |
$date1 = date_create($desc['gep_startdate']); |
OlderNewer