• 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 adding new fields

Dynamically adding new fields 15 years 9 months ago #7796

  • josinjo
  • josinjo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello!

Im interested is it possible to dynimically add new fields. I need form for reserving airplane tickets so i need new field (passenger name) to be added automatically when user choose in the dropdown menu new number of passengers,for example when he choose 2(number of passengers),then there will appear 2 fields for writing 2 passengers names...

Thanks

Josip
The administrator has disabled public write access.

Re:Dynamically adding new fields 15 years 9 months ago #7826

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You will have to create a custom script that will do that. RSForm! Pro in the current version can not do this. Create a custom script and add in the scripts called on form display, or however you think it will work.

Regards!
The administrator has disabled public write access.

Re:Dynamically adding new fields 14 years 1 month ago #13086

Hello,
I was wondering if the current version of RS Form Pro 1.3.0 R36 is able to handle such thing.
The administrator has disabled public write access.

Re:Dynamically adding new fields 14 years 1 month ago #13090

  • willkey
  • willkey's Avatar
  • OFFLINE
  • Junior Boarder
  • smart, engaged, and curious
  • Posts: 32
I, too, am hoping to find information about this.

What I need is to have a series of text entry boxes displayed when an option above is chosen.

Like the attached image:



Am I dreaming, or can this be done?
-- remember where you've been...it helps with where you're going!

:)
The administrator has disabled public write access.

Re:Dynamically adding new fields 14 years 2 weeks ago #13222

Hi,

I would also be interested in that feature. That would be a nice addon.
The administrator has disabled public write access.

Re:Dynamically adding new fields 13 years 9 months ago #14148

  • lucvg
  • lucvg's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
is this now possible ?
The administrator has disabled public write access.

Re:Dynamically adding new fields 13 years 9 months ago #14149

Hello,
I hope this will be of help to you. I contracted for an outside source to do this feature for me. I will share the code here but understand, I don't know how it works so I can't answer any questions on it. I'm just happy to have my form do what I want it to.
Note: the code in the Javascript area contains two sets of code. One to do the radio group display and one to look at the current date and then put up a specific price depending on the month of the year. You'll have to change the code so you get only what you want, I expect.

The form can be found at:
www.nemgtr.org/index.php?option=com_cont...application&catid=39
I suggest you look at it first and then go from there.


Add to CSS/Javascript tab
<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>
Add the following to the Additional Attributes of the radio group:
onclick="hideCarElemenets();"

This is the set up of the radio group:
1|1 Car   
2|2 Cars   
3|3 Cars   
4|4 Cars

Hope this helps out. And maybe it will spark some more sharing of code for the forum users. I've found lots of interesting things to add to my forms by looking through the posts.

Regards,
Kathy
Web Manager, www.nemgtr.org
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
The administrator has disabled public write access.

Re:Dynamically adding new fields 13 years 8 months ago #14307

Thank you Kathy!

I really needed this function as well.

I am having trouble understanding how it works though. Any chance you could provide a backed-up version (without submissions of course)??

Thank you!

Rainie dey
The administrator has disabled public write access.

Re:Dynamically adding new fields 13 years 8 months ago #14310

Hi,
Send me your email address and I'll get it to you. I admit it -- I don't know how to post a backup on the forum. Still learning... my address is below.


Kathy
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
The administrator has disabled public write access.

Re:Dynamically adding new fields 13 years 8 months ago #14328

Thank you!
Last Edit: 13 years 8 months ago by rainie285.
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!