ADDed rows hidden in edit form

  • totallnet
  • totallnet's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 325
  • Thank you received: 11

totallnet created the topic: ADDed rows hidden in edit form

I used this code to add new line (section) in my form
function addremoveprecos () {
var i=1;
var add=ff_getElementByName('add_row_precos').id;
var del=ff_getElementByName('del_row_precos').id;

jQuery('#'+add).click(function(){ // If 'add row' button is clicked
   for (i;i<=20;i++) //maximum amount of 20 rows
   {
      var id='#precos'+i; // get section id
      var setting = jQuery(id).css('display'); 
      if (setting=='none')
      {
         jQuery(id).css('display', 'block'); // Displays the section with the specific id
         break;
      }
   }
});
jQuery('#'+del).click(function(){
   for (i;i>1;i--) //maximum amount of 2 rows
   {
      var id='#precos'+i; // get section id
      var setting = jQuery(id).css('display');
      if (setting=='block')
      {
         jQuery(id).css('display', 'none'); // Disable the section with the specific id
         break;
      }
   }
});
}

I have one select list field where i are populated from data in DB.. i used this code
<?php
$out = '';
$db = JFactory::getDBO();
$db->setQuery("SELECT posicao FROM qrp2j_posicao ORDER BY posicao ASC");
$contents = $db->loadObjectList();
foreach( $contents As $content ){
    $out .= '0;'.$content->posicao.';'.$content->posicao."\n";
}
return $out;
?>

I used Content Builder to show this data in frontend... awesomescreenshot.com/0104gun156
But if i try to edit ... those rows created shows me closed and the select lista data are lost...
See here awesomescreenshot.com/02f4gunrdd
In frontend is ok... just to edit i have this problems..

What can i do??

Thanks in advance

Kazuo
Level I support
Official Breezing Forms Support
Skype: totallnet 18pm-22pm -3UTC
===============================================
Satisfied? Consider a membership!
===============================================
Follow us on Twitter
===============================================
#139939
  • Posts: 6983
  • Karma: 187
  • Thank you received: 628

chrisal replied the topic: ADDed rows hidden in edit form

Hello totallnet,


the problem is, that the form will always opened with it's initial status - style/Visibility changes will not be saved.

those rows created shows me closed

You have to save the number of visible rows somewhere(hidden input/element?) and create a new, small script which checks this value and turn on the correct number of sections e.g:
if(saved value = 3){
//Make three rows visible
}

select lista data are lost

Same problem here. The code will be executed everytime you open the form and overwrite the stored value.



regards
Chris

Regards,
Christian

===============================================
Satisfied? Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
#140104
  • totallnet
  • totallnet's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 325
  • Thank you received: 11

totallnet replied the topic: ADDed rows hidden in edit form

Thanks for your reply...

Can you give more detailed code??
Thanks in advance

Kazuo
Level I support
Official Breezing Forms Support
Skype: totallnet 18pm-22pm -3UTC
===============================================
Satisfied? Consider a membership!
===============================================
Follow us on Twitter
===============================================
#140140
  • Posts: 7
  • Thank you received: 0

guillegal replied the topic: ADDed rows hidden in edit form

Hi Chrisal,

I need the same code, but I don't understand where I have to put that code. Could you please make an example: if (saved value=2), show "section1" and "section2"

Thanks a lot!
#140750
  • Posts: 6983
  • Karma: 187
  • Thank you received: 628

chrisal replied the topic: ADDed rows hidden in edit form

Hello guillegal,


do you use your own custom form or our 'add rows' sample?

If you use our sample - have you edited it somehow e.g. changed section names etc?



regards
Chris

Regards,
Christian

===============================================
Satisfied? Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================
#141004
  • Posts: 7
  • Thank you received: 0

guillegal replied the topic: ADDed rows hidden in edit form

Hi Chrisal,

I use the "add-rows" sample, change sections name and the max. rows to 5, and it works perfect, but I need to show (turn on) all rows with data.

Thanks!!!
#141027
Moderators: ForumSupporttomeperica
Time to create page: 0.044 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here