Skip to content

Instantly share code, notes, and snippets.

View sonichandni's full-sized avatar
💻
Focusing

Chandni Soni sonichandni

💻
Focusing
View GitHub Profile
@sonichandni
sonichandni / style.css
Created February 17, 2022 06:17
new line added in textarea, show as it is on html
p {
white-space: pre-line;
}
@sonichandni
sonichandni / file.js
Last active November 23, 2021 06:20
Unselect other multiple choices when the user selects none or anything related to none like none of above or none option
$(document).on('click', '.checkboxClass', function () {
if($(this).val().includes("none")) {
cr_val = $(this).val();
ch_nm = $(this).attr('name');
$("input[name='"+ch_nm+"'][value!='"+cr_val+"']").prop("checked",false);
} else {
ch_nm = $(this).attr('name');
$("input[name='"+ch_nm+"']").each( function() {
console.log($(this).val());
if($(this).val().includes("none")) {
@sonichandni
sonichandni / file.js
Created October 26, 2021 12:46
js get elements
var th = $(this);
th.closest('.summary-input-div').nextAll('.summary-input-div:visible').first().find("input").focus();
// find any closest parent div
- closest();
// find any closest child div
- find();
// find only div which are visible in dom
@sonichandni
sonichandni / file.js
Created October 25, 2021 10:46
check if css is exsist in specific element
if ($("#h1").css("color") == "rgb(0, 128, 0)") {
down.innerHTML = "H1 has CSS style, color: green";
} else {
down.innerHTML = "H1 has not CSS style, color: green";
}
@sonichandni
sonichandni / css
Last active March 23, 2023 08:49
css responsive
//ipad pro
//@media(min-width:1023px) and (max-width:1200px) {
//}
---:New:----
.shadow-box {
background: #fff;
box-shadow: 0 4px 24px 0 rgb(34 41 47 / 10%);
}
/* Mobile devices */
@sonichandni
sonichandni / input.html
Created October 19, 2021 13:44
display image inside input box at the end
<style>
.icon {
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
}
</style>
<div class="form-group" style="position: relative">
@sonichandni
sonichandni / file.php
Last active September 23, 2021 13:36
array search
<!-- Array
(
[0] => Array
(
[form_id] => 224
)
[1] => Array
(
[form_id] => 237
@sonichandni
sonichandni / style.css
Created September 16, 2021 11:48
Remove up-down arrow from input number fields
/*Remove up down arroww from number field start*/
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none !important;
-moz-appearance: none !important;
appearance: none !important;
margin: 0 !important;
}
@sonichandni
sonichandni / html_for_international_calling coes.htm
Created July 3, 2020 10:06 — forked from andyj/html_for_international_calling coes.htm
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
@sonichandni
sonichandni / file.js
Last active June 5, 2020 06:41
redirect a page to another page when refresh at second attempt
submitFormOkay = false;
$(document.body).on("click", "a", function() {
submitFormOkay = true;
});
window.onbeforeunload = function(event) {
event.preventDefault();
if (!submitFormOkay) {
window.setTimeout(function () {
window.location = "{!!LaravelLocalization::localizeURL('/dashboard')!!}";
}, 0);