Welcome, Guest

Condition for hidden input
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Condition for hidden input

Condition for hidden input 2 years, 1 month 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, 1 month 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, 1 month 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, 1 month ago by Slawinski.

Re:Condition for hidden input 2 years 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 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 1 year, 11 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.37 seconds

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany