Skip to content

Instantly share code, notes, and snippets.

View sbassah's full-sized avatar

Samuel Bassah sbassah

View GitHub Profile
@sbassah
sbassah / JQueryremove_ddoption.js
Last active November 20, 2020 13:52
Removes Dropdown option if selected in another dropdown. // Add "gfield_ddselect" class name to all the dropdown fields
jQuery(".gfield_ddselect").change(function() {
var select_num = jQuery(".gfield_ddselect").length; // Check for the number of dropdowns having the class.
var ddvalue =[];
var selected = jQuery("option:selected", jQuery(this)).val(); // Gets the value of the seclected option
jQuery(".gfield_ddselect").each(function(i) {
ddvalue[i] = jQuery("option:selected", jQuery(this)).val(); // Assigns the selected values of all the dropdown to an array
i+=1;
});
var thisID = jQuery(this).attr("id"); // Get's the ID of the currently selected element
jQuery(".gfield_ddselect").each(function(a) { // Loops through all the dropdowns
<script >
jQuery(document).on('gform_post_render', function(event, form_id, current_page){
var gformid = 70; // Form ID
var textarea_id = 56; // Paragraph ID
if (form_id == gformid){
document.querySelector("#input_"+form_id+"_"+textarea_id).addEventListener('keyup', count);
function count(){
var value = document.getElementById("input_"+form_id+"_"+textarea_id).value;
@sbassah
sbassah / gravityview-trigger-gform_after_submission-form-20.php
Last active February 28, 2019 02:20 — forked from zackkatz/gravityview-trigger-gform_after_submission-form-12.php
GravityView - Trigger the `gform_after_submission` action when an entry is edited, but ONLY for Form #20.
<?php
/**
* GravityView doesn't trigger the `gform_after_submission` action when editing entries. This does that,
* but ONLY FOR FORM #20.
*
* @param array $form
* @param int $entry_id ID of the entry being updated
* @param GravityView_Edit_Entry_Render $object
*