Skip to content

Instantly share code, notes, and snippets.

View anil826's full-sized avatar
🏠
Working from home

Anil anil826

🏠
Working from home
  • New Delhi , India
View GitHub Profile
@anil826
anil826 / validation.js
Last active May 11, 2021 13:10
Custome Javascript Validation
$(".finish").on("click", function (ev) {
ev.stopImmediatePropagation();
let isValid = true;
//Loop on all formyoula fields
Object.keys(formyoula.form_fields).forEach(function(component_id) {
//Regex for element component id
if (/^[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}$/.test(component_id)) {
//Get component
let component = formyoula.form_fields[component_id];
//Check if component attribute is available and value is empty
@anil826
anil826 / Risk.html
Created April 29, 2021 10:57
RickPDFHTML
<section>
<div class="wrapper">
<main class="page-body">
<table align="center" border="1" cellpadding="0" cellspacing="0" style="width: 890px;">
<tbody>
<tr height="60px">
<td style="width: 188px; "><img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAAChCAYAAAAr3q30AAAgAElEQVR4Ae2dBZhdxdnHKe5aXIoUK8XdvbhDKS4tH06wIAVSJGiRtmghQIgTAkk2rhvPZuPu7i67Gw/v9/wGJp09OXrvXN2Z57l77t5zzsg78n9t3tlMXHIUcBRwFHAUcBRwFCg6CmxWdC1yDXIUcBRwFHAUcBRwFBAH8G4QOAo4CjgKOAo4ChQhBRzAF2GnuiY5CjgKOAo4CjgKOIB3Y8BRwFHAUcBRwFGgCCngAL4IO9U1yVHAUcBRwFHAUcABvIj8/PPPsnLdeqlYu042/PxzxkYF5bjkKOAokDsKuDmYO9q7kuNRwOYYrfEAD6BPr6ySx8uGy/kdesuQRUtl3YYN8Xoi4VM2Oy5h0e5xRwFHgV+ZeUcIR4F8poBNnKjRAA8hp1eslEfLhstm37WWLb5rLX/q1FfKFy6RtRkAeZsdl88D1NXNUSBfKeDmYL72jKuXpoDNMVqjAX5m5f/AHYDXIH9ll/5StmCxrLEM8jY7Tg8Gd3UUcBSITwE3B+PTyj2ZGwrYHKM1FuAB98d+ldw1uOvrlg1ayzXdyqQ/IL/enrreZsflZui5Uh0FCpsCbg4Wdv/VhNrbHKM1EuCnVVTJEwOGK5W8BnXvFZC/rluZ9JtvD+RtdlxNGOiujY4Cting5qBtirr8bFPA5hitcQA/ZUWlcqjbtmEb
@anil826
anil826 / Risk.css
Created April 29, 2021 10:56
Risk.css
<style>
p {
font-size: 12px;
font-weight: normal;
}
table {
max-width: 890px;
font-size:12px;
border-collapse: collapse;
display: table;
@anil826
anil826 / backupSunil.pdf.html
Last active August 12, 2020 09:12
sunil backup
<style type="text/css">table,td {
font-family: Arial;
}
</style>
<!-- {{formyoula_repeat_152d-8bfc-7826}} -->
<table border="0" cellpadding="1" cellspacing="1" style="width:100%;">
<tbody>
<tr>
<td>{{3c18-7f4e-9fa4}}</td>
</tr>
@anil826
anil826 / delete_button.js
Last active July 30, 2020 11:37
Updated Javascript for delete button functionality
//On repeate update
var total_prefilled_records;
formyoula.form_fields["8ba9-776a-b85e"].on('input:set:success', function (e) {
//Get total record
total_prefilled_records = formyoula.form_fields["8ba9-776a-b85e"].get('repeat_value').length;
for (var i=0; i<total_prefilled_records ; i++) {
if ( formyoula.form_fields["8ba9-776a-b85e"].get('repeat_value')[i][1].value ) {
$('a[data-item_index="'+i+'"]').hide();
}
}
@anil826
anil826 / updated.js
Last active July 30, 2020 11:05
Updated Javascript for showing header
//On prefill of repeat group
var repeat_group_component_id = "8ba9-776a-b85e";
var increment_counter = 0;
var total_repeat_item_field = 0;
formyoula.form_fields["8ba9-776a-b85e"].on('prefill:success', function (){
formyoula.event_trigger("main:spinner_dialog", { show: true});
total_repeat_item_field = formyoula.form_fields["8ba9-776a-b85e"].get("repeat_value").length;
if (formyoula.form_fields["8ba9-776a-b85e"].get("repeat_value").length ==0) {
$('.custom-loader').hide();
} else {
@anil826
anil826 / sample.html
Created April 14, 2020 14:32
Sample HTML of Email Body
<!--{{#if 770b-a80d-fc65}} -->
<p>xx</p>
{{a2b4-d74a-c254}}
yy
<!-- What to do next starts here-->
<!--{{#if 9647-7b34-541c}}-->
{{95a6-9212-278d}}
<!--R1 starts here-->
<!--{{#if 387e-e9f6-b0cd}} -->
@anil826
anil826 / syngentabck.js
Created January 28, 2020 18:01
syngentabck
<script type="text/javascript" src="https://d3iyvxaud7i110.cloudfront.net/vendor/jquery/jquery-2.1.3.min.js"></script>
<script>
(function(){
$(".is_checked_new").attr("style","display:none");
$(".is_checked_existing").attr("style","display:none");
if ($(".is_checked_existing").attr("data-field_value") === "No") {
$(".is_checked_existing").attr("style","display:block");
}
if ($(".is_checked_new").attr("data-field_value") === "Yes") {
$(".is_checked_new").attr("style","display:none;");
@anil826
anil826 / htmlbackup.html
Created December 27, 2019 16:19
pramodHTMLbackup
<p style="text-align: center;"><span style="font-size:16px;"><strong>E - Formul&aacute;ř pro GDPR {{0f47-1f31-3c62}}</strong></span></p>
<table cellpadding="0" cellspacing="0" style="width: auto; margin-left: auto; margin-right: auto;">
<tbody>
<tr>
<td style="width: auto;"><strong><span style="color: #008000;">Poučen&iacute; o zpracov&aacute;n&iacute; osobn&iacute;ch &uacute;dajů a souhlas s jejich zpracov&aacute;n&iacute;m</span></strong></td>
</tr>
<tr>
<td style="width: auto;">
<p>&nbsp;<strong>Spr&aacute;vce osobn&iacute;ch &uacute;dajů</strong> je Syngenta Czech s.r.o., IČO: 45146365, se s&iacute;dlem Bucharova 1423/6, 158 00 Praha 5 &ndash; Stodůlky, zapsan&aacute; v obchodn&iacute;m rejstř&iacute;ku veden&eacute;m Městsk&yacute;m soudem v Praze, odd&iacute;l C, vložka č. 8308, e-mail: [email protected], webov&aacute; str&aacute;nka: <a href="https://www.syngenta.cz/">https://www.syngenta.cz/</a></p>
@anil826
anil826 / sample.js
Last active November 15, 2019 16:17
Sample code for Qty calcuation 2 different table
formyoula.form_fields['50a7-888a-450e'].on("table:results:render:success",function(r){
//Hide the product id coloum
$("#salesforce_table_2f7b-db31-bc5b").DataTable().column(4).visible(false);
$("#salesforce_table_50a7-888a-450e").DataTable().column(7).visible(false)
//First table
var parent_table = $("#salesforce_table_2f7b-db31-bc5b").DataTable();
//second table
var child_table = $("#salesforce_table_50a7-888a-450e").DataTable();
//Get all the table data
var parent_table_data = parent_table.rows().data().toArray()