Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

value list

Status
Not open for further replies.

yuchieh

MIS
Jul 21, 2000
178
US
I have a value list (radio buttons) that contains three values (the same field name). Like this,
Comment: * comment1 * comment2 * comment3

I would like to make a script that when a user checks one certain value (if check comment2), send an alert email to someone.
So far, I made the whole value list field connect to the script. So no matter which button to check, the script is activated, which is not what I want. Also, When I switch buttons, they are not changed.

My script is below --

if ["not IsEmpty(CommentType) and PatternCount( CommentType , "comment2" )"]
Beep
SendEmail["comment2 email"]
End if


Thank you.
 
Make 3 scripts, one for each step.

Start the scripts with the set field command, something along these lines

Set field (your field); "Comment 1"
Perform script, subscript, send comment1mail

Make a rectangle in layout mode, transparent, no lines and put that over your first radiobuttonfield.
Do the same for the others, and attache your scripts to it.

Now, when you click on a radiobutton, the script will set your radiobutton and perform the apropriate script.

HTH

 
works only half way. When I first click on this radio button (one of the options), it works. If I click on other options first, then click on this option, the script button doesn't work.


Thanks.
 
Maybe I was too short with details :

you have your 'buttonfield' with the 3 buttons, formatted as radiobutton on a layout. Valueslist for this field :
comment1, comment2, comment3...

For each choise of the radiobuttons you have a script :
script button1 - do something when button 1 is choosen
script button2 - do something when button 2 is choosen
same for nr 3.

The first thing the scripts has to do is set your buttonfield to the value of the choosen radiobutton.

Script button1 will start with set field 'your buttonfield' to 'comment1',
and then the rest for the action to take if comment1 radiobutton is choosen.

The same for the other scripts, start with the set field command,

In layout, over each radiobutton (3 in your case) a rectangle, invisible, attach script 1 to rect 1, 2 to 2, 3 to 3...

Now, if you click the first radiobutton, comment 1, it will trigger the first script, set the radiobuttonfield to the value comment1, and do the rest of the script...
same for nr 2 and 3...

HTH
 
Working now. I found that under radion buttons field, go to Field Format, I had "Behavior, Allow entry into field" checked, which caused the problem.

Thank you for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top