Welcome, Guest
  • Page:
  • 1
  • 2

TOPIC: Condition for hidden input

Condition for hidden input 2 years, 4 months ago #10897

I need to make a hidden input with a value which depend on the value of a radiogroup. The values are integer and I need to make hidden input value as a text. So let say my radiogroup value is 100, so the hidden input value is text1... Could anyone help?
  • Slawinski
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Karma: 0

Re: Condition for hidden input 2 years, 4 months ago #10925

Hi,

put a custom action on EACH of your checkboxes (click "click" event and then "create code framework").

Inside the generated function, within the "click" case, put something like this:

if(element.checked && element.value == '100'){
  ff_getElementByName("nameofhidden").value = 'text1';
}
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re:Condition for hidden input 2 years, 4 months ago #10953

Thanks TheMuffinMan,

it's working. I changed checkboxes into radiogroups and I added else statement in the function.
  • Slawinski
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
Last Edit: 2 years, 4 months ago by Slawinski.

Re:Condition for hidden input 2 years, 3 months ago #11505

Another problem to sum numbers.
I have to summarize few numbers and increase some values is some radio groups are checked.
I have such function:

function ff_brunch1_action(element, action)
{
switch (action) {
case 'click':
if(element.checked && element.value == 'Yes'){
ff_getElementByName("hid_brunch1").value = '10';
ff_getElementByName("tc").value = ff_getElementByName("tc").value+10;
}else{
ff_getElementByName("hid_brunch1").value = '0';
}
break;
default:;
} // switch
} // ff_brunch1_action

I need to increase the value of "tc" element (tc it's a hidden input) by 10 if the radio brunch_1 is checked into "Yes". The initial value of the "tc" element is an integer number.
But the calculation doesn't work - it takes all the values as strings, not integer numbers. The result is 13510 instead od 145 (result shown on the next page with summaries). How to fix it?
  • Slawinski
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Karma: 0

Re:Condition for hidden input 2 years, 3 months ago #11515

Hi,

try this

ff_getElementByName("tc").value = !isNaN(ff_getElementByName("tc").value) ? Number( ff_getElementByName("tc").value ) + 10 : 10;
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re:Condition for hidden input 2 years, 2 months ago #12460

Another Summarize issue

I need to summarize a Select-List with multiple Radio Boxes selected yes or no.

My Select-List is Package_Interest
0;System / Network Monitoring $25/month;value1
0;Application Monitoring $65/month;value2
0;Managed Alerting $125/month;value3
0;End-User Experience $250/month;value4

My Radio Groups are
Remote_Checks
0;Yes;Yes $5
1;No;no $0

additional_URL
0;Yes;yes $10
1;No;no $0


Also would be nice to summarize on the fly but if not, I am okay with a summary page.
I have more but if some one can get me going, as I am new to this, Much appreciated.

~Jeremy
  • junruh
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 0
  • Page:
  • 1
  • 2
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.43 seconds

Facebook Discount - 40% Off!

Fans of our Facebook page here are entitled to get a 1-year-subscription for the price of a 6-months!

Steps to take:

  • Become a fan on Facebook (Like) here
  • Purchase a 6-months-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of your like and we'll upgrade to the 1-year-subscription

Joomla!® Forms Discount - 40% Off!

Already purchased a forms extension from a different vendor but your requirements changed and now you need a forms extension that is capable of more than just the standards? We help you to keep the costs for a change under control: Get a 40% discount on our professional membership plan! -- meaning timely unlimited access to all current and future commercial extensions, breezingforms themes & apps and Joomla!® templates at crosstec.de, including 1 year of support -- without any website limitations -- Just prove that you previously purchased another forms extension for Joomla!® from a different vendor and you are qualified.

Steps to take:

  • Purchase a 1-year-subscription from here
  • Write a quick email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your username and prove of the purchase for the other form vendor and we'll upgrade to the professional-subscription

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany

Imprint