Distance2006 Posted July 28, 2006 Share Posted July 28, 2006 I am having trouble with "if" statements based on the contents of radio button fields. I have a radio button field with six choices. The choices come from a custom value list I've been trying to get a script to change to a certain layout depending on the content of that field. I've tried "If Field = "one of the six choices" then perform script, but it does not seem to work. I've tried a pattern count approach to the content of the radio button selected field as well with no luck. Finally, I created a script that copies and pastes the contents of that field into another field. Then I do the "if" on that new field, and this seems to work. Am I doing something wrong with the Radio Button fields. I seem to have a similar issue with actions taken on fields that are drop downs versus when the user actually types the word. I think these are related problems and I'm missing something pretty basic Any help would be appreciated. Thanks, Quote Link to comment Share on other sites More sharing options...
Ender Posted July 28, 2006 Share Posted July 28, 2006 It's hard to diagnose from what you've given us. It would help if you could provide a sample file, or at least post the actual script and provide some actual field values that are not working. Quote Link to comment Share on other sites More sharing options...
Distance2006 Posted July 29, 2006 Author Share Posted July 29, 2006 I'll try to describe the script better. My radio button field is called "Coverage" and has six custom values: GPL PEC CPL CM CPL Occ GL/PL GL/CPL My functional scrip right now reads: If coverage = "CPL CM" perform script "Go to CPL CM Choice" Else if coverage = "CPL Occ" perform script "Go to CPL Occ Choice" Else Perform script "Go to GPL Choice" I've tested each sub script, and they all do as they are supposed to. It's failing to make the choice here. I don't know if it's the formating of the words or perhaps the spacing? As I said in the earlier post, I seem to have a similar problem with drop down selections. I have a field called "Carriers" It is populated with about 100 names of companies. Some are slight variations of the same name that need to be there. In order to grroup them all together, I've created a field called "Carrier Master" I am trying to get all of the variations grouped together under this master name. I've tried to create a find that says: If Carrier = "company a" insert text in "carrier master" where the text inserted is the group name I've done the exact variation of the 100 names in the drop down list (very tedious) and it still will not do the find properly. I posted this earlier and got the suggestion to use patterncount, which seems to work. What I don't understand is why this isn't working the way I scripted it. I think both of these are connected issues about how I'm doing someithng when the information is provided to the user, either as a radio button or a drop down. Thanks for taking a look. Quote Link to comment Share on other sites More sharing options...
comment Posted July 29, 2006 Share Posted July 29, 2006 Most likely the problem is spaces or other invisible characters. Quote Link to comment Share on other sites More sharing options...
Ender Posted July 29, 2006 Share Posted July 29, 2006 Also, make sure the field type in this case is Text. You might look at a copy of your problem field with the value list removed. Is there more than just the one line of text (like an extra carriage return)? Could there be old values still in there (from when the value list showed different values)? If there are multiple values, old values, or line returns, then your If[] calc as written won't work. You would need to either clean up the data, or use patterncount() or position() for scan the field for the desired text. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.