September 5, 200520 yr Right, im sure this isnt that complex (but i can be a tad daft sometimes), i have 5 fields, single checkboxes with a value list set to each with the only option being "yes" within the checkbox (i know you can have one field with 5 options ive just being having trouble with the if statements). If certain checkboxes are selected i need a calculated result to be entered into another field. I.e. if field one is checked, add in text specific to that field. If field two is set to yes add more text to the previous text entered as a result of checkbox one being set to yes and so on. So i guess my final question is how would i setup a script to check which of the five checkboxes are checked (lets call the fields a - e) and insert text specific to whether or not those fields are set to "yes". I assume this has something to do with loops but i am yet to understand it. Help would be great, cheers in advance genx
September 5, 200520 yr Why dont want have calculation field as: Text=Case(Field1="Yes","Field1_Checked","")& Case(Field2="Yes"," Field2_Checked","")& Case(Field3="Yes"," Field3_Checked","")& Case(Field4="Yes"," Field4_Checked","")& Case(Field5="Yes"," Field5_Checked","")
September 5, 200520 yr Other options exists though, if you instead make the valuelist {1,2,4,8,16} instead and draw the single field in a way that hides these numbers, fiddling with custom linespacing makes sense as well. This makes this posible: Choose ( Evaluate ( Substitute ( CheckboxField ; "¶" ; " + " ) ) ; result0 {; result1 ; result2...} ) I would expect it to be slightly faster than Case'ing, and if searches are likely does it make sence to have just one indexed instead of five. --sd
September 5, 200520 yr Aren't you forgetting this is a checkbox field? A single field, with a list of 5 values, has 32 (2^5) possible states. Are you going to write out all 32 possible results for the Choose() function?
September 5, 200520 yr Aren't you forgetting this is a checkbox field? No I'm not ...it just occured to me that if you structure this way are you forced to think of all posibilities in a organized manner. Not that it's needed in this case, but... --sd
September 5, 200520 yr I have nothing against thinking. I was objecting to excessive typing. Here's how I would do this. (Seems upload is broken now - I'll try later)
September 5, 200520 yr Yes, hiccups occure ...eventhough I was among the jaw-droppers at devcon, when the topic was PHP ...might this be a flaw in the machinery serving or...: --sd
September 6, 200520 yr Author cheers guys, comment your way ended up workin best. For future reference where do you get the § symbol and what abouts does it mean? Cheers
September 6, 200520 yr The actual character used is not important. I happen to have a non-standard keyboard with easy access to this character, but you can use any character that is not going to be used in the text. It has no meaning - it merely tags the last ¶, so that you don't end up with a trailing " and ".
Create an account or sign in to comment