TOPIC:

ADDed rows hidden in edit form 5 years 4 months ago #139939

  • totallnet's Avatar Topic Author
  • totallnet
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 325
  • Thanks: 11
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
===============================================

Please Log in or Create an account to join the conversation.

ADDed rows hidden in edit form 5 years 4 months ago #140104

  • chrisal's Avatar
  • chrisal
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 6983
  • Karma: 187
  • Thanks: 629
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

Please Log in or Create an account to join the conversation.

ADDed rows hidden in edit form 5 years 4 months ago #140140

  • totallnet's Avatar Topic Author
  • totallnet
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 325
  • Thanks: 11
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
===============================================

Please Log in or Create an account to join the conversation.

ADDed rows hidden in edit form 5 years 4 months ago #140750

  • guillegal's Avatar
  • guillegal
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
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!

Please Log in or Create an account to join the conversation.

ADDed rows hidden in edit form 5 years 4 months ago #141004

  • chrisal's Avatar
  • chrisal
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 6983
  • Karma: 187
  • Thanks: 629
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

Please Log in or Create an account to join the conversation.

Last edit: Post by chrisal.

ADDed rows hidden in edit form 5 years 4 months ago #141027

  • guillegal's Avatar
  • guillegal
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 7
  • Thanks: 0
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!!!

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.052 seconds

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!