• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Dynamically add multiple instances of a field

Dynamically add multiple instances of a field 9 years 9 months ago #28002

My form has a line containing a set of fields which a user may need multiple times:

Item# Pieces Price etc.

The number of lines (sets of fields) needed can vary from 0 to any number. Is there a way to accomplish something like this jsfiddle.net/tZPg4/10485/ in an RSForm Pro? (user clicks a button to add another set of fields to show on the form.)
The administrator has disabled public write access.

Dynamically add multiple instances of a field 9 years 7 months ago #28672

donmarvin wrote:
My form has a line containing a set of fields which a user may need multiple times:

Item# Pieces Price etc.

The number of lines (sets of fields) needed can vary from 0 to any number. Is there a way to accomplish something like this jsfiddle.net/tZPg4/10485/ in an RSForm Pro? (user clicks a button to add another set of fields to show on the form.)

I have the same problem. Anyone ?
The administrator has disabled public write access.

Dynamically add multiple instances of a field 9 years 7 months ago #28777

  • IanM
  • IanM's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Looking for the same solution if anyone can help?
The administrator has disabled public write access.

Dynamically add multiple instances of a field 9 years 7 months ago #28811

Hello,
A few years ago I had assistance with the same (sort of) type of request. I did not write this code-- I'm not a programmer... so I do not know how it works... just that it does.
What I needed was for the user to select from a radio button field the number of cars that they wished to tell us about (this is a membership application). When they clicked one, one set of fields were shown. Click two and then two sets of fields are shown and so on up to 4.
While this is not exactly what you want, the code posted below may be a starting point for you to modify and get the type of "dynamic" sets of input that you want.
It goes in the Properties>CSS & JavaScript part of the form. I'm pretty sure that the last few lines of code go to another function that we had working at one time. You can probably get rid of the part that deals with price.

If you wish to email me at This e-mail address is being protected from spambots. You need JavaScript enabled to view it and I can provide a backup of the form with only this "radio button" section that you can restore on your site to see if it can be adapted. You can view the form in action at www.nemgtr.org/index.php/application/39-...mbership-application
Advance to the second page.


<script type="text/javascript">
function hideCarElemenets()
{
for(i=0;i<4;i++)
for(j=1;j<=7;j++)
document.getElementById('c'+(i+1)+'h'+j).style.display = 'none';

var number = 0;
for(i=0;i<document.getElementsByName('form[CatNumber]').length;i++)
if(document.getElementById('CatNumber'+i).checked)
{
number = parseInt(document.getElementById('CatNumber'+i).value);
break;
}
//alert(number);
for(i=0;i<number;i++)
{
for(j=1;j<=7;j++)
document.getElementById('c'+(i+1)+'h'+j).style.display = '';
}

}
function monthSelection()
{
today = new Date();
currMonth = today.getMonth();
if(currMonth <= 3)
{
document.getElementById('paypal-1385').options[1].selected = true;
document.getElementById('paypal-1385').options[0].disabled = true;
document.getElementById('paypal-1385').options[2].disabled = true;
}
if(currMonth <= 11 && currMonth > 7 && currMonth > 3)
{
document.getElementById('paypal-1385').options[0].selected = true;
document.getElementById('paypal-1385').options[1].disabled = true;
document.getElementById('paypal-1385').options[2].disabled = true;
}
if(currMonth <= 7 && currMonth > 3)
{
document.getElementById('paypal-1385').options[2].selected = true;
document.getElementById('paypal-1385').options[0].disabled = true;
document.getElementById('paypal-1385').options[1].disabled = true;
}
}

window.addEvent('domready', function() {
hideCarElemenets();
monthSelection();
getPrice_51();
});

</script>
The administrator has disabled public write access.

Dynamically add multiple instances of a field 8 years 7 months ago #32324

  • Toad78
  • Toad78's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 27
Were you able to find a solution using RSForms Pro? I'm trying to do something similar.
The administrator has disabled public write access.

Dynamically add multiple instances of a field 8 years 7 months ago #32357

  • soluware
  • soluware's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hello I try the same thing have you advanced
The administrator has disabled public write access.

Dynamically add multiple instances of a field 6 years 4 months ago #37641

  • dietze6
  • dietze6's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
bump
The administrator has disabled public write access.

Dynamically add multiple instances of a field 5 years 4 months ago #38688

  • s.byford
  • s.byford's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Need this too
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!