February 18, 200718 yr Is it possible to use a container field as a sort of single radio button? What I mean by this is; I currently have calculated fields to show a 'star' rating - 0 to 5. I use a drop-down for the initial number and this is then translated via a container (6 global) to show a graphic of corresponding 'stars' What would be cool is to just click the container and let the 'stars' advance until you reach the desired 'rating' - any ideas? Thanks in advance! Frank.
February 18, 200718 yr Okay, i didn't catch a lot of how you're doing it at the moment, but I'd use three fields and one script to acheive this... First Field, Repeating Global Container Field, 6 repetitions. Rep 1 stores image for zero stars, Rep 2 stores image for one stars etc up to six. Second Field, Rating -- Just a number field. Third Field, Calculation, result container, calculation being: firstField[secondField] Finally, the script that you can attach to your third field i.e. your container: Set Field[ SecondField ; Case( SecondField = 6 or IsEmpty( SecondField ) ; 1 ; secondField + 1 ) ] Commit Record/Request[] Edited February 18, 200718 yr by Guest
February 18, 200718 yr Author Something like this? EXACTLY like that! Many thanks! Thanks also to Genx, although your solution (in print) went over my head a little... Frank. Edited February 18, 200718 yr by Guest
February 18, 200718 yr Author ...Just one slight problem - my 'stars' start at zero and go through to 6 (not 1 - 5), this throws evertyhing out by 1, the zero seems to be invalid(!) Frank.
February 18, 200718 yr Here's another way, you can then modify the calculated icon field to select different containers if you wish via the choose command. Rod RatingCalc.fp7.zip
February 18, 200718 yr Author Here's another way, you can then modify the calculated icon field to select different containers if you wish via the choose command. Rod Thanks! This is (vitually) the same as my orginal set-up (Radio Buttons instead of hi-lite buttons though) Frank.
February 18, 200718 yr Sorry did not read close enough, here's what I think your looking for. Rod RatingCalc_2.fp7.zip
February 18, 200718 yr Author Sorry did not read close enough, here's what I think your looking for. Rod Thanks Rod! Near-perfect - my first rating needs to be zero (5 stars blanked), using a zero in the calc doesn't seem to work though... Maybe I need something like ? Frank. Edited February 18, 200718 yr by Guest
February 18, 200718 yr Have you thought about trying to modify one of the example files that were posted. I just looked at the one comment posted, and it would be easy to modify it to 6 stars. Change the value list by adding 6 to the list Go into define fields and change the gStarsR to 6 Repetitions Go into layout mode and click on gStarsR field and change it to 6 repetitions Go into Browse mode and copy and paste 6 star into the last repetition. HTH Lee
February 18, 200718 yr Author ...I already tried all that; selecting zero gives a blank, selecting 1 gives 2 stars and so on. Where am I going wrong? Frank.
February 18, 200718 yr I am not sure I understand the problem - do you mean you have a picture to go with rating 0? If so, just change the definition of cStars to: GetRepetition ( gStarsR ; Rating + 1 ) If not, please explain further.
February 18, 200718 yr The solution that Comment has posted should work for your needs. However, there was a thread on here a few years ago asking about a netflix type star images that I posted to. It probably is not the exact solution that you are looking for, but it might give you some ideas or clarify things for you. Netflix Stars
Create an account or sign in to comment