• 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: trying to build a Contact Your Legislator form

trying to build a Contact Your Legislator form 17 years 3 months ago #1599

  • rietze
  • rietze's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello,

I'm trying to build a Contact Your Legislator form for a political site.

Here's my example: www.idahoea.org/index.php?option=com_forme&fid=8

Here's how it'd work.

1. User selects district (first select box - choices are 1-35)
2. This populates second select box with choice of Legislator names.
3. Once they choose the Legislator from 2nd select box I want to have an email address associated with their selection and use this as the variable for the Email Form data to field in RSform.

#3 above is where I'm lost. I'm modifying the pizza form code, but not sure how to carry the person's email address in the array? Or do I need another array?

Thanks in advance for help with my weak javascript skills. Sean Rietze
The administrator has disabled public write access.

Re:trying to build a Contact Your Legislator form 17 years 3 months ago #1684

  • alex
  • alex's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 443
  • Thank you received: 3
Hi Rietze,

i see you worked it out. I'll post a solution here for the others:
Basicly, after you create the select 1, name it Sel1 and add to it's attributes the code: onchange=\"this.changeSel2(this.selectedIndex)\", you create the second Select(that can be empty, name it Sel2). The javascript code should look like this(i did not tested it, so it may contain some js errors..):

Code:
function changeSel2(index){
MyOption = new Array();
MyOption[0] = new Array();
MyOption[0][0] = 'Bank';
MyOption[0][1] = 'Retail Store';
MyOption[0][2] = 'etc.';
 
MyOption[1] = new Array();
MyOption[1][0] = 'Steak';
MyOption[1][1] = 'Chinese';
MyOption[1][2] = 'Fast Food';
 
Sel2 = document.getElementById('Sel2');
//empty Sel2 items first
for(i=0;i<Sel2.options.length;i++){
Sel2.options[i] = null;
}
//populate with new items
for(i=0;i<MyOption[index].length;i++){
Sel2.options[i] = new Option(MyOption[index][i],MyOption[index][i]);
}
}
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!