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 / sample.html
Last active August 13, 2019 15:52
sample-neha
<style type="text/css">p.p1 {margin: 1px 1px 1px 1px; font: 12px Sans-serif}
table { page-break-inside:avoid}
</style>
<table border="0" cellpadding="1" cellspacing="1" style="width:100%;">
<thead>
<tr>
<th scope="col" style="text-align: left;"><strong style="font-family: Sans-serif; font-size: 16px;">&nbsp;<!-- {{#compare 5026-f759-d863 'GH' operator='==' }} --> Seed Advisor Transaction Statement<!-- {{/compare}} --><!-- {{#compare 5026-f759-d863 'NK' operator='==' }} --> Retailer Transaction Statement <!-- {{/compare}} --> </strong></th>
<th scope=""><!-- {{#compare 5026-f759-d863 'GH' operator='==' }} -->{{e4b7-8576-0491}} <!-- {{/compare}} --> <!-- {{#compare 5026-f759-d863 'NK' operator='==' }} --> {{7a8b-396b-4712}} <!-- {{/compare}} --></th>
<th scope="col" style="text-align: right;">
<p><span style="font-size:16px;"><strong><span style="font-family: Sans-serif;">Crop Year&nbsp;</span></strong></span>{{c6d9-46bb-c23e}}</p>
@anil826
anil826 / set_value.js
Created July 24, 2019 06:36
SygnetaGustavo
formyoula.form_fields["6ee2-acfd-2e89"].on("input:set:success",function(){
console.log('On add==');
//Set value of hidden field
formyoula.form_fields["4392-e578-b146"].set({"value": ''});
});
@anil826
anil826 / backup-pramodDE.js
Created July 11, 2019 08:00
SyngentaDEPramode
/***********************Dependency List************************* **/
//Dependency JSON
var product1 = {
"Alibaba groß Rapspalette": ["Alibaba groß Rapspalette","01u1o00000OuSj0AAF"],
"One": ["One"],
"test": ["test"],
"Amazon.de Gutschein 25 Euro": ["Amazon.de Gutschein 25 Euro", "01u1w000003n5CaAAI"]
}
@anil826
anil826 / onAddRepeat.js
Created July 1, 2019 13:57
checkAtlistOnProductAvailable (syngenta)
var is_product_available = false;
/*************************************************/
//on click
formyoula.form_fields['c47a-5772-e40f'].on('element:create:success',function() {
//Loop for repeat index
for (var repeat_index=0; repeat_index < window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value').length; repeat_index++ ) {
is_product_available = true; //True if any product is added
//Looop for component data
for ( var i_component = 0; i_component < window.formyoula.form_fields["c47a-5772-e40f"].get('repeat_value')[repeat_index].length; i_component++ ) {
@anil826
anil826 / sygenta-Shantanu-check_email_atleast_one.js
Last active July 1, 2019 14:16
Check checkbox in repeat group validation
//Collect data of email checkbox
var email_check_uncheck_data = [];
//Check on next click
$('.next').on('click', function(e) {
e.stopImmediatePropagation();
for (var repeat_index=0; repeat_index < window.formyoula.form_fields["7221-d2aa-1adf"].get('repeat_value').length; repeat_index++ ) {
//Looop for component data
for ( var i_component = 0; i_component < window.formyoula.form_fields["7221-d2aa-1adf"].get('repeat_value')[repeat_index].length; i_component++ ) {
/****************Code for email validation****************/
if ( window.formyoula.form_fields["7221-d2aa-1adf"].get('repeat_value')[repeat_index][i_component].label == "Trimite Email" ) {
@anil826
anil826 / pramodePicklist.js
Created June 25, 2019 11:24
PramodPicklist dependency
/***********************Dependency List***************************/
//Dependency JSON
var product1 = {
"Alibaba groß Rapspalette": ["Alibaba groß Rapspalette"]
}
//Repeat group event on adding the record
formyoula.form_fields['f7e2-c61c-8a3a'].on('element:create:success',function() {
//Loop for repeat index
for (var repeat_index=0; repeat_index < window.formyoula.form_fields["f7e2-c61c-8a3a"].get('repeat_value').length; repeat_index++ ) {
@anil826
anil826 / selectFirstFromPicklit.js
Last active June 25, 2019 05:53
Select first option
//On change event for new repeat group data.
$('.new_repeat_entry_panel #component-6ee2-acfd-2e89 .input_content').change(function(){
//SetTimeout to wait for the options to load.
setTimeout(function(){
//Select first option from picklist you need to change the compoent-id
$('.new_repeat_entry_panel #component-49b8-df0d-2c75 .input_content > option:eq(1)').prop('selected', true);
},500)
})
//Existing repeat loop - please change the repeat group id.
@anil826
anil826 / validationOnAdd.js
Created June 19, 2019 04:23
OnAddRepeat validation
//On add item event
formyoula.form_fields[reward_repeat_element].on("element:create:success",function(e) {
//Validation for Total Earned Points >= Reward quantity.
if ( formyoula.form_fields[gold_member_component].get("value") ) {
if ( parseFloat(formyoula.form_fields[total_reward_quantity].get("value")) >= parseFloat(formyoula.form_fields[total_points_with_doublication].get("value")) ) {
//If validation failed remove last added item
var repeat_v = formyoula.form_fields[reward_repeat_element].get("repeat_value");
repeat_v.pop();
formyoula.form_fields[reward_repeat_element].set("repeat_value",repeat_v ).trigger("change")
alert("you can not have more reward quantity then total earned points with doublication");
//f91c-fbee-dc28 , 7cf5-cdb6-598d component id of required fields
$(document).on('keyup','.existing_repeat_entry_panel #component-f91c-fbee-dc28 , #component-7cf5-cdb6-598d', function(){
//Check the value of requied filed
//Loop for repeat index
//37ac-1f73-b669 component id of repeat group
for (var repeat_index=0; repeat_index < window.formyoula.form_fields["37ac-1f73-b669"].get('repeat_value').length; repeat_index++ ) {
//Check the value of requied filed
if ($('#collapse_37ac-1f73-b669_'+repeat_index+' #component-f91c-fbee-dc28 .input_content').val() && $('#collapse_37ac-1f73-b669_'+repeat_index+' #component-7cf5-cdb6-598d .input_content').val()) {
//Enable the submit button
$(".finish").attr('disabled',false);
@anil826
anil826 / repeat_group_validation_existing_element.js
Created June 7, 2019 05:52
Required Filed validation for repeat group
$(document).on('keyup','.existing_repeat_entry_panel #component-85c0-fbd0-4cf4', function(){
//Check the value of requied filed
//Loop for repeat index
for (var repeat_index=0; repeat_index < window.formyoula.form_fields["5fb5-8b93-521e"].get('repeat_value').length; repeat_index++ ) {
//Check the value of requied filed
if ($('#collapse_5fb5-8b93-521e_'+repeat_index+' #component-85c0-fbd0-4cf4 .input_content').val()) {
//Enable the submit button
$(".finish").attr('disabled',false);
} else {
//Disable the submit button