:)
我正在使用重力表单列表字段,并在其中一个列上创建了一个select字段。我还使用重力特惠复制猫插件,以便列字段,然后复制选定的值到第二列。
第1列(产品名称)应具有输入标签,第2列(产品ID)应具有该值。
唯一的问题是,当我试图将数据传递给其他表单时,第1列默认返回到值。
这是我的密码。是否可以添加一行以确保在复选框中使用输入标签?
还是有别的办法来处理这件事?
add_filter( 'gform_column_input_104_7_1', 'Individual', 10, 5 );
function individual( $input_info, $field, $column, $value, $form_id ) {
return array(
'type' => 'select',
'choices' => array(
array( 'value' => '2837', 'text' => 'A0256-0 Mediana A10 AED Pads (Adult)'),
array( 'value' => '526', 'text' => 'AA01 Antiseptic Cream Sachet 1g'),
array( 'value' => '522', 'text' => 'AAB100 Amputated Parts Bag'),
array( 'value' => '528', 'text' => 'AAS50 Antiseptic Spray 50ml'),
array( 'value' => '536', 'text' => 'AB3 Burn Gel 3.5g Sachet'),
array( 'value' => '1057', 'text' => 'ABC10 Calico Triangular Bandage 110cm x 110cm'),
array( 'value' => '1453', 'text' => 'ABC10SU Calico Triangular Bandage 110cm x 110cm Single Unit'),
array( 'value' => '1451', 'text' => 'ABCH100 Cohesive Bandage Blue 10cm x 4.5m (Box 12)'),
array( 'value' => '1047', 'text' => 'ABCH100SU Cohesive Bandage Blue 10cm x 4.5m'),
array( 'value' => '1472', 'text' => 'ABCH25 Cohesive Bandage Blue 2.5cm x 4.5m Box 12'),
array( 'value' => '1043', 'text' => 'ABCH25SU Cohesive Bandage Blue 2.5cm x 4.5m'),
array( 'value' => '1452', 'text' => 'ABCH50 Cohesive Bandage Blue 5cm x 4.5m (Box 12)'),
array( 'value' => '1044', 'text' => 'ABCH50SU Cohesive Bandage Blue 5cm x 4.5m'),
array( 'value' => '1474', 'text' => 'ABCH75 Cohesive Bandage Blue 7.5cm x 4.5m Box 12'),
array( 'value' => '1045', 'text' => 'ABCH75SU Cohesive Bandage Blue 7.5cm x 4.5m'),
array( 'value' => '538', 'text' => 'ABD10 Burn Gel Dressing 10cm x 10cm'),
array( 'value' => '1471', 'text' => 'ABN10 Non-Woven Triangular Bandage 110cm x 110cm'),
array( 'value' => '680', 'text' => 'ABN10SU Non-Woven Triangular Bandage 110cm x 110cm'),
array( 'value' => '542', 'text' => 'ABS1010SU Burn Sheet 10cm x 10cm'),
array( 'value' => '2983', 'text' => 'ABS2020SU AEROBURN™ PE Burn Sheet 20cm x 20cm'),
array( 'value' => '2984', 'text' => 'ABS6090SU AEROBURN™ PE Burn Sheet 60cm x 90cm'),
array( 'value' => '563', 'text' => 'ACA150 Cotton Tip Single End Applicator (100)'),
array( 'value' => '545', 'text' => 'ACD1010SSU Combine Dressing 10cm x 10cm'),
array( 'value' => '547', 'text' => 'ACD1020SSU Combine Dressing 10cm x 20cm'),
array( 'value' => '549', 'text' => 'ACD2020SSU Combine Dressing 20cm x 20cm'),
array( 'value' => '1843', 'text' => 'ACE100SU Elastic Cotton Crepe Bandage 10 cm X 4m'),
array( 'value' => '1042', 'text' => 'ACE50SU Elastic Cotton Crepe Bandage 5cm x 4m'),
array( 'value' => '1454', 'text' => 'ACM100SU Medium Cotton Crepe Bandage 10cm x 4M'),
array( 'value' => '1461', 'text' => 'ACM150SU Medium Cotton Crepe Bandage 15cm x 4m'),
array( 'value' => '1466', 'text' => 'ACM25SU Medium Cotton Crepe Bandage 2.5cm x 4m'),
array( 'value' => '575', 'text' => 'ACM50SU Medium Cotton Crepe Bandage 5cm x 4m'),
array( 'value' => '577', 'text' => 'ACM75SU Medium Cotton Crepe Bandage 7.5cm x 4m'),
array( 'value' => '1054', 'text' => 'AD1000 Detectable Bandage Extra Wide'),
array( 'value' => '1055', 'text' => 'AD1001 Detectable Bandage Wide Patch'),
array( 'value' => '1475', 'text' => 'AD1007B AEROPLAST PREMIUM DETECTABLE BANDAGES Dressing Strip'),
array( 'value' => '866', 'text' => 'AEDA15 Mediana A15 Defibrillator'),
array( 'value' => '870', 'text' => 'AEDC AED Cabinet'),
array( 'value' => '585', 'text' => 'AEP1SSU Eye Pad Sterile'),
array( 'value' => '1476', 'text' => 'AF100SU Conforming Bandage 10cm x 4M'),
array( 'value' => '551', 'text' => 'AF25SU Conforming Gauze Bandage 2.5cm x 4m'),
array( 'value' => '553', 'text' => 'AF50SU Conforming Gauze Bandage 5cm x 4m'),
array( 'value' => '557', 'text' => 'AF75SU Conforming Gauze Bandage 7.5cm x 4m'),
array( 'value' => '682', 'text' => 'AF9 Tweezers Stainless Steel 7.5cm'),
array( 'value' => '898', 'text' => 'AFAK2S Voyager Versatile First Aid Kit'),
array( 'value' => '886', 'text' => 'AFAK3S Defender Versatile First Aid Kit'),
array( 'value' => '890', 'text' => 'AFAK4S Responder Versatile First Aid Kit'),
array( 'value' => '2826', 'text' => 'AFAK4T Aero Responder Series 4 Tackle Box Kit'),
array( 'value' => '894', 'text' => 'AFAK5S Operator Versatile First Aid Kit'),
array( 'value' => '880', 'text' => 'AFAK6S Commander Versatile First Aid Kit'),
array( 'value' => '875', 'text' => 'AFAKLSB-1 Comprehensive Snake Bite & Spider Bite First Aid Kit'),
array( 'value' => '821', 'text' => 'AFAKRW Regulator Remote Work Kit'),
array( 'value' => '2546', 'text' => 'AFAKSB Snake Bite Kit'),
array( 'value' => '2555', 'text' => 'AFAKSB-2 Snake Bite Kit X 2'),
array( 'value' => '1056', 'text' => 'AFB13 Forceps Blunt Stainless Steel'),
array( 'value' => '1886', 'text' => 'AFH100SU Heavyweight Conforming Bandage 10cm x 4 mtr'),
array( 'value' => '1477', 'text' => 'AFH50SU Heavy Weight Conforming Bandage 5cm x 4M'),
array( 'value' => '1041', 'text' => 'AFH75SU Heavy Weight Conforming Bandage 7.5cm x 4m'),
array( 'value' => '1478', 'text' => 'AFHSB100 Snake Bite Bandage w/indicator 10cm x 10.5M Pack 12'),
array( 'value' => '1479', 'text' => 'AFHSB100SU Snake Bite Bandage w/indicator 10cm x 10.5M'),
array( 'value' => '1480', 'text' => 'AFID6SSU Aerofix Island Dressing 6cm x 8cm'),
array( 'value' => '1481', 'text' => 'AFID8SSU Aerofix Island Dressing 9 x 10cm'),
array( 'value' => '676', 'text' => 'AFP11 Forceps - Disposable'),
array( 'value' => '595', 'text' => 'AFP350 Fabric Knuckle Dressings 40 Pkt'),
array( 'value' => '599', 'text' => 'AFP501 Fabric Plasters 100 Pkt'),
array( 'value' => '1048', 'text' => 'AFP50125 Fabric Dressing Strips (25)'),
array( 'value' => '597', 'text' => 'AFP5015 Fabric Plasters 50 Pkt'),
array( 'value' => '1049', 'text' => 'AFP506 Fabric Large Patch (25)'),
array( 'value' => '1482', 'text' => 'AFP601 AEROPLAST PREMIUM FABRIC BANDAGES X-Wide Strip Box 100'),
array( 'value' => '1483', 'text' => 'AFP6015 AEROPLAST PREMIUM FABRIC BANDAGES X-Wide Strip Box 50'),
array( 'value' => '591', 'text' => 'AFP701 Fabric Dressing Strip 7.5cm x 1m'),
array( 'value' => '1874', 'text' => 'AFPW010SU Waterproof Island Dressing 10 x 12cm'),
array( 'value' => '1876', 'text' => 'AFPW015SU Waterproof Island Dressing 15 x 20 cm'),
array( 'value' => '662', 'text' => 'AFS001 Face Shield Disposable'),
array( 'value' => '1484', 'text' => 'AFSB10 Short Snake Bite Bandage w/indicator 10cm x 4.5M Pack 12'),
array( 'value' => '1485', 'text' => 'AFSB10SU Short Snake Bite Bandage w/indicator 10cm x 4.5M'),
array( 'value' => '690', 'text' => 'AFT25SU Zinc Oxide Tape 2.5cm x 5m'),
array( 'value' => '601', 'text' => 'AGB001 First Aid Guide Booklet'),
array( 'value' => '2985', 'text' => 'AGBL AEROGUIDE Burns First Aid Card'),
array( 'value' => '2986', 'text' => 'AGEL Eye wound Treatment Card'),
array( 'value' => '603', 'text' => 'AGL001 First Aid Guide Leaflet'),
array( 'value' => '607', 'text' => 'AGNPF02 Gloves Nitrile PF Large Pair'),
array( 'value' => '1486', 'text' => 'AGNPF10 Nitrile Gloves Powder Free Large Pack 5 Pairs'),
array( 'value' => '1487', 'text' => 'AGS75 Non-Sterile Gauze Swab 7.5 x 7.5cm Pack 100'),
array( 'value' => '605', 'text' => 'AGS753SSU Gauze Swabs 7.5cm x 7.5cm (3) sterile'),
array( 'value' => '1488', 'text' => 'AGS755SSU Gauze Swab 5 Pcs White 7.5cm x 7.5cm'),
array( 'value' => '2793', 'text' => 'AHC5001 Reusable Hot & Cold Pack 29 x 12cm'),
array( 'value' => '622', 'text' => 'AII2500 Ice Pack Instant Small 80g'),
array( 'value' => '2598', 'text' => 'AII2500 BOX 96 Ice Pack Instant Small 80g BOX OF 96'),
array( 'value' => '620', 'text' => 'AII5000 Ice Pack Instant Large 240g'),
array( 'value' => '2391', 'text' => 'AKM006 FIRST AID Metal Cabinet Medium Drop Front'),
array( 'value' => '2960', 'text' => 'ALCOHOWIP155N Liv-Wipe Antibacterial Alcohol Wipes 155 per Tub'),
array( 'value' => '2067', 'text' => 'ALCOWIPES50 75% ALCOHOL WIPES PK 50'),
array( 'value' => '884', 'text' => 'AM01 CPR Face Mask'),
array( 'value' => '1489', 'text' => 'AP101 AEROPLAST PLASTIC BANDAGES Standard Strip Box 100'),
array( 'value' => '652', 'text' => 'AP10125 AEROPLAST PLASTIC BANDAGES Standard Strip 25 Pkt'),
array( 'value' => '654', 'text' => 'AP1015 AEROPLAST PLASTIC BANDAGES Standard Strip 50 Pkt'),
array( 'value' => '634', 'text' => 'AP312SU Microporous Paper Tape 1.25cm x 5m'),
array( 'value' => '1490', 'text' => 'AP325DSU Microporous Tape with Dispenser 2.5cm x 9.1M'),
array( 'value' => '1491', 'text' => 'APD100S Low Adherent Dressing Pad 10cm x 7.5cm Box 50'),
array( 'value' => '646', 'text' => 'APD100SSU Low Adherent Dressing Pad 10cm x 7.5cm'),
array( 'value' => '1492', 'text' => 'APD101S Low Adherent Dressing Pad 10cm x 10cm Box 50'),
array( 'value' => '640', 'text' => 'APD101SSU Low Adherent Dressing Pad 10cm x 10cm'),
array( 'value' => '1493', 'text' => 'APD102S Low Adherent Dressing Pad 10cm x 20cm Box 50'),
array( 'value' => '642', 'text' => 'APD102SSU Low Adherent Dressing Pad 10cm x 20cm'),
array( 'value' => '1494', 'text' => 'APD50S Low Adherent Dressing Pad 5cm x 5cm Box 50'),
array( 'value' => '644', 'text' => 'APD50SSU Low Adherent Dressing Pad 5cm x 5cm'),
array( 'value' => '1495', 'text' => 'APD75S Low Adherent Dressing Pad 7.5cm x 5cm Box 50'),
array( 'value' => '1053', 'text' => 'APD75SSU Low Adherent Dressing Pad 7.5cm x 5cm'),
array( 'value' => '3292', 'text' => 'APWC7535 Wound Closure Strips 3mm x 75mm Box 50'),
array( 'value' => '672', 'text' => 'APWC7535SU Wound Closure Strips 3mm x 75mm 5pkt'),
array( 'value' => '2016', 'text' => 'AQIUM375 Aqium 375 mls'),
array( 'value' => '666', 'text' => 'ASC13 Scissors 12.5cm Sharp / Blunt'),
array( 'value' => '648', 'text' => 'ASN096P Note Pad & Pen'),
array( 'value' => '2786', 'text' => 'ASN100-L Nitrile Finger Cots Large Box 100'),
array( 'value' => '2789', 'text' => 'ASN100-L-50 Nitrile Finger Cots Large Packet 50'),
array( 'value' => '2791', 'text' => 'ASN100-M Nitrile Finger Cots Medium Box 100'),
array( 'value' => '2790', 'text' => 'ASN100-M-50 Nitrile Finger Cots Medium Packet 50'),
array( 'value' => '674', 'text' => 'ASP100SU Splinter Probes (5)'),
array( 'value' => '664', 'text' => 'ASP12 Safety Pins (12)'),
array( 'value' => '636', 'text' => 'AT25SU Transparent Tape Microperforated 2.5cm x 5m'),
array( 'value' => '581', 'text' => 'ATB130 Emergency Thermo Blanket'),
array( 'value' => '2718', 'text' => 'AV2000 AEROPLAST PREMIUM VISUAL BANDAGES 7.5 x 2.5cm box/100'),
array( 'value' => '590', 'text' => 'AW1060SU Sodium Chloride Eye Wash Ampoule 15ml'),
array( 'value' => '1037', 'text' => 'AW1510SU Vomit Bag'),
array( 'value' => '2631', 'text' => 'AW7100 Alcohol Swab Box 100'),
array( 'value' => '517', 'text' => 'AW7100SU Alcohol Swab'),
array( 'value' => '530', 'text' => 'AW8000SU Antiseptic Wipe 200mm x 100mm'),
array( 'value' => '1496', 'text' => 'AW8110 Alcohol-Free Cleansing Wipes 200 x 100mm ENV 10'),
array( 'value' => '684', 'text' => 'AWD13SSU Wound Dressing #13'),
array( 'value' => '686', 'text' => 'AWD14SSU Wound Dressing #14'),
array( 'value' => '688', 'text' => 'AWD15SSU Wound Dressing #15'),
array( 'value' => '579', 'text' => 'AWDPB01 Dressing Pack Basic'),
array( 'value' => '1497', 'text' => 'AWP16100SU Povidone Iodine Swabs 60 x 33mm'),
array( 'value' => '1498', 'text' => 'BHB2538 Biohazard Clinical Waste'),
array( 'value' => '2149', 'text' => 'BOOC MASK DISPOSABLE FACE MASKS PKT 10'),
array( 'value' => '2156', 'text' => 'BOX 50 MASK DISPOSABLE FACE MASKS BOX 50'),
array( 'value' => '2160', 'text' => 'BOX 50 MASK-1 DISPOSABLE FACE MASKS BOX 50 BULK ORDER 20+BOXES Please contact us for your pricing'),
array( 'value' => '2844', 'text' => 'CA-05 AED A4 Wall Sticker Sign'),
array( 'value' => '2842', 'text' => 'CA-06 AED On Site Sticker'),
array( 'value' => '2863', 'text' => 'CA-08 AED in Vehicle (Small Self-Stick Vinyl) 10 × 12 cm'),
array( 'value' => '2846', 'text' => 'CA-10 AED 3D Angle Bracket Wall Mount Sign (Poly)'),
array( 'value' => '2853', 'text' => 'CA-PK1 AED Premium Prep Kit'),
array( 'value' => '2848', 'text' => 'CA-PK2 AED Basic Prep Kit'),
array( 'value' => '3867', 'text' => 'CC-60 CARDIACT Alarmed Outdoor AED Cabinet with Lock 48 x 47 x 31cm'),
array( 'value' => '567', 'text' => 'CWD001 CPR Flowchart Card CWD001'),
array( 'value' => '2244', 'text' => 'EARSAVERS Plastic Ear Savers PK 5'),
array( 'value' => '587', 'text' => 'EB001 Eye Wash Bath'),
array( 'value' => '1499', 'text' => 'EGA60 Antibacterial Hand Gel 60ml'),
array( 'value' => '2182', 'text' => 'FaceShield Full Face Shield Anti-Fog'),
array( 'value' => '2620', 'text' => 'FAR210 R2 Workplace Response First Aid Kit, Metal Wall Mount'),
array( 'value' => '2622', 'text' => 'FAR299 R2 Workplace Response Refill Pack'),
array( 'value' => '1500', 'text' => 'FCP-03 Civilian Trauma & Haemorrhage Control Wound Dressing (white) 10 x 17cm'),
array( 'value' => '1501', 'text' => 'FCP-06 Civilian Trauma & Haemorrhage Control Wound Dressing (white) 15 x 18cm'),
array( 'value' => '2578', 'text' => 'GB002 Green First Aid Bag Medium'),
array( 'value' => '630', 'text' => 'KD160 Kidney Dish Plastic 200ml'),
array( 'value' => '2128', 'text' => 'LIVTHERMO Infrared Forehead Thermometer TGA Approved'),
array( 'value' => '668', 'text' => 'ND90 Needle Disposal Unit 90ml'),
array( 'value' => '3053', 'text' => 'NEOG997 The Neo G Airflow Breathable Arm Sling'),
array( 'value' => '1502', 'text' => 'PPC60 Plastic Portion Cup 60ml'),
array( 'value' => '650', 'text' => 'PTD06 Disposable Pen Light Torch'),
array( 'value' => '2995', 'text' => 'RI001 Register of Injuries Pad'),
array( 'value' => '2971', 'text' => 'RST101 RapidStop® Tourniquet Orange'),
array( 'value' => '2987', 'text' => 'SBL Snake Bite Treatment Leaflet'),
array( 'value' => '3017', 'text' => 'SG002 Vortex Safety Spectacles Clear'),
array( 'value' => '517', 'text' => 'Alcohol Swab AW7100SU ' ),
array( 'value' => '1503', 'text' => 'SOFTT-W-R SOFTT-W Tourniquet Orange'),
array( 'value' => '872', 'text' => 'SPLINT1 18 inch Moldable Splint'),
array( 'value' => '543', 'text' => 'ST30SU Chlorhexidine Liquid 30ml'),
array( 'value' => '1841', 'text' => 'Stingoes 25 Stingoes Spray 25 ml'),
array( 'value' => '2964', 'text' => 'TPAP 1 Placebo Asthma Puffer (For Training Only)'),
array( 'value' => '1848', 'text' => 'Tuffie 5 Tuffie 5 Wipes'),
array( 'value' => '1845', 'text' => 'TuffieIPA Tuff Wipes 200 Canister'),
array( 'value' => '1530', 'text' => 'USP19 Universal Scissors 19cm'),
array( 'value' => '3004', 'text' => 'Zoll AED 3B Zoll AED 3 Battery'),
array( 'value' => '3939', 'text' => '501FS First Aid Sticker 15 x 22.5 cm'),
array( 'value' => '2857', 'text' => '501JS First Aid Signs (Small Self-Stick Vinyl) 10 × 14 cm'),
array( 'value' => '2607', 'text' => '8000-0807-01 ZOLL AED PLUS BATTERIES X 10'),
array( 'value' => '2802', 'text' => '8900-000280 Zoll CPR Uni-padz Universal (Adult/Pediatric) Electrodes for Zoll AED 3'),
array( 'value' => '2807', 'text' => '8900-0800-01 Zoll AED + CPR-D-Padz® One-Piece Electrode Pad With Real CPR Help')
));
} ```
I am aware that populate anything could assist with dynamic population but they cannot work with list columns at this point in time...
发布于 2022-07-07 23:20:18
你在用Woocommerce做你的产品吗?当将值传递给另一个表单时,您可以简单地使用列2中的值来为第1列创建产品名吗?
例如,如果您拥有列2中的产品id,可以执行以下操作吗?:
$product_id = wc_get_product( **value from column 2** );
product_name=$product_id->get_name();//pass $product_name to new form instead of grabbing column 1
发布于 2022-07-22 15:07:24
感谢GravityWiz帮助我完成这一任务。他们真的是巫师!
我的代码需要附上一些javascript。我安装了重力表单自定义Javascript插件,然后添加了此代码以配合我的php代码:
gform.addFilter( 'gppc_copied_value', function( value, $elem, data ) {
if ( data.source != '2611.1' || data.target == '2611.2' ) {
return value;
}
var found = jQuery( '#field_' + data.sourceFormId + '_' + parseInt( data.source ) ).find( 'option[value="' + value + '"]' ).first().text();
value = found ? found : value;
return value;
} );
https://stackoverflow.com/questions/72897782
复制相似问题