0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Fabrik coding help - Javascript var to php?

    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Fabrik coding help - Javascript var to php?

    Posted 14 years 3 months ago
    • Hi Guys.
      Totally off topic with RT but i know some of you guys use fabrik so hopefully someone can help?

      Im editing a plugin they have created for a bespoke purpose but having some issues.

      The javascript is:
      var fbTableUpdateCol = FbTablePlugin.extend({
       
           initialize: function(tableform, options, lang) {
       
                this.setOptions(tableform, options);
       
                this.lang = Object.extend({'selectrow':'Please select a row!'}, lang || {});
       
                window.addEvent('domready', function() {
       
                this.tableid = this.tableform.getElement('input[name=tableid]').value;
       
                     this.watchButton();
       
                }.bind(this));
       
           },
       
           
       
           watchButton:function() {
       
                var button = this.tableform.getElement('input[name='+this.options.name+']');
       
                if(!button) {
       
                     return;
       
                }
       
                button.addEvent('click', function(event) {
       
                     var e = new Event(event);
       
                     e.stop();
       
                     var ok = false;
       
                     this.tableform.getElements('input[name^=ids]').each(function(c) {
       
                          if(c.checked) {
                               var y=window.prompt("please enter a reason")
                               if (y!=null && y!="") {
                                    ok = true;
                               } else {
                                    ok = 'noreason';
                               return; 
                               }
                          }
                     });
                     
       
                     if(ok == false) {
       
                          alert(this.lang.selectrow);
       
                          return;
       
                     } else if(ok == 'noreason') {
       
                          return;
                     }
       
                     this.tableform.getElement('input[name=fabrik_tableplugin_name]').value = 'update_col';
       
                     this.tableform.getElement('input[name=fabrik_tableplugin_renderOrder]').value = button.name.split('-').getLast();
       
                     oPackage.submitfabrikTable(this.tableid, 'doPlugin');
       
                }.bind(this));
       
           }
       
           });

      How do i pass the y variable to the update_col php script?

      Any ideas?
    • Kiss my RSS

Time to create page: 0.066 seconds