• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Logic \"IF conditional\" return something...

Logic \"IF conditional\" return something... 16 years 8 months ago #4164

Hi!

I just have a dropdown question form with answer \"yes\" or \"no\" or \"blank\". I want to return conditional text to those inputs.

Thanks,
A.
The administrator has disabled public write access.

Re:Logic \"IF conditional\" return something... 16 years 8 months ago #4179

I'm not sure what you mean by \"return conditional text\" - where do you want the text to appear?
  • If you want something to change on the form itself, that would have to be done by Javascript code in the first script in the Scripts tab for the form (script called on form display).
  • If you mean that the text would go in the database, that would be written using PHP in the second script in the Scripts tab (script called on form process).
  • If you want something special in the notification email, I don't know how to do that.
Give us a litte more specific info, and perhaps we can help.
The administrator has disabled public write access.

Re:Logic \"IF conditional\" return something... 16 years 8 months ago #4237

I got 6 questions, they are \"yes\" or \"no\" dropdown. I wanna be able to return a specific text on the \"thank you page\" for each of them depending on the answer given by the user for each of those questions.

For example: if a user input \"yes\" to the first question, i wanna be able to reply \"alright thank you thats great I wanna work with you\", but if on the other hand its a \"no\" i reply something different like \"sorry, not this time\".

I need a returned text for each of those individual questions, aligned on the thank you page.

Thanks.
The administrator has disabled public write access.

Re:Logic \"IF conditional\" return something... 16 years 8 months ago #4263

That sounds fairly easy. When you build your options for each select box, make the value be the text you want to appear on the Thank You page, and the description be the words you want in the selection box. The Default Value for the field would look something like:
n/a|Select...,I wanna work with you|Yes,Sorry not this time|No
(I included a default entry that forces them to choose, rather than favoring Yes or No as the default; but you don't have to have that if you want one or the other answer to be the default.) Then include the field names in curly braces wherever in the Thank You page you want that text to appear.

Naturally this method would cause the text, rather than the simple \"Yes\" or \"No\", to be entered in the RSForm database table and to be sent in the notification email, but you know what those phrases mean, so perhaps it wouldn't be a problem.
The administrator has disabled public write access.

Re:Logic \"IF conditional\" return something... 16 years 8 months ago #4374

Is it possible to illustrate that with clearly marked field names and an example of it because this sounds Chinese to me since I've never worked with RSform before.

I assume that the value are to be input in the left column but theres of option and i'm not sure what i'm doing.

I'll try again:

A yes or no question with a default field that is \"-\" or \" ?\"

So, if \"Yes\": prompt \"I wanna work with you\" on the Thank You page after submited (how to use the curly braces in the thank you page? I need an example, i dont understand how to use them)

if \"No\": prompt \"I dont want to work with you\"

if \"?\" or \"-\" : Meaning default and not answered, prompt \"Please go back and fill up the missing fields.

Thanks
The administrator has disabled public write access.

Re:Logic \"IF conditional\" return something... 16 years 8 months ago #4411

First of all, let me point out that it is very helpful to check the \"Field Notes\" on the right side of the Edit Field screen - most of the syntax clues I know came from reading that section.

For a select box, the Field Notes says:
Add as Default Value the value|Description of the options separated by coma(,).
Example: value1|Description 1,value2|Description 2,value3|Description 3.
The \"description\" (the part after each | character) is what the user will see as his choices in the drop-down box, and the \"value\" (the part before the | character) will be what is sent for processing, and will be what appear in place of the placeholder {myselectbox} when you put it in the Thank You page, the notification Email, or anywhere else. Typically the descriptions are longer than the values (because the values are usually only used internally by the website administrators), but it doesn't have to be that way.

So for your situation, I was suggesting that the value be what you want to say in the email. Here's the syntax example using the text you asked for, but with extra spaces and carriage returns in it to make it more readable (don't use those when you do it for real - it should be all one line), and I'll add color to show you the different parts - red is the value, blue is the description, and separators are black - the comma between each option and the vertical bar between the value and the description.

Please go back and fill up the missing fields. | ? ,
I wanna work with you | Yes ,
I dont want to work with you | No


Does that help?

You said you don't understand the {field} placeholders either, but I don't know how to explain it any better - in your Thank You page, your Email, or anywhere else like that, if you put the name of one of your fields in curly braces ( like {myfield} ), whatever is the value of that field when the form is submitted will appear in that spot. I don't know the name of your selectbox field, but that's what you would put between the braces.
if \"?\" or \"-\" : Meaning default and not answered, prompt \"Please go back and fill up the missing fields.
Be aware that so far we have only been talking about what goes on the Thank You page or in an email after the form is submitted. If you want a \"validation\" prompt, in other words, you want RSForm to not accept the form until Yes or No is selected, that's a different thing. I have never tried to use RSForm's standard validation on a selectbox (only on text fields), but you could try the \"mandatory\" validation setting. Instead of the text \"Please go back...\", put nothing at all before that first vertical bar, which will make the value of that option blank (make sure there are no spaces or anything before the | character). In RSForm's \"Validation\" setting for that field, select \"mandatory\". Once you have selected that, you can edit the validation message if you like. Then apply the changes and try using your form - hopefully if you try to submit the form with the selectbox still at the first option (which would have a value of nothing but a description of \"?\"), RSForm will show you your validation message and send you back to the form. If instead, the form goes through with no protest, next try making both the value and the description blank - the very first character would be the vertical bar and the second would be the comma, like \"|,I wanna work with you|Yes,I dont want to work with you|No\". If that still doesn't trigger RSForm's validation and stop the form submission, then that type of validation doesn't work on selectboxes and you'd need to do custom validation, which appears to only be offered in RSForm Pro.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!