Page 1 of 1

changing answer style

Posted: Wed Dec 09, 2009 2:42 am
by greggarcia
Sorry fo to many doubt about using Revtalk but has been two weeks learning the basic, but i was unable to find an answer for this:
i want to know if it is possible change the text style when we use answer command? for example i want to show to the user:
answer "Hello" && field "fname" && "the right answer is..." && tresult
where field "fname" is the name of the user who has been login at the beginning
tresult is the temporary variable that i used to keep some data.

So how can i change the text style of "fname" in the answer dialog? i would like to put emphasis in the "fname"

thanks so much
greg

Re: changing answer style

Posted: Wed Dec 09, 2009 2:53 am
by sturgis
You can specify html tags in your prompt string to accentuate the parts you want.

From the dictionary
Comments:
The prompt can be either formatted text (in the htmlText property's format) or plain text. If the prompt contains <p> or a start/end tag pair, the answer command assumes the text is in the same format as the htmlText property. Otherwise, the answer command assumes the text is plain text.
So

Code: Select all

answer "<B>This is Bold</b> <i>This is italic</i>"
Will show an answer dialog with This is Bold This is Italic

Re: changing answer style

Posted: Wed Dec 09, 2009 3:29 am
by greggarcia
Sturgis, thanks i am tried but it works fine with text not for field inside de answer, i put like this answer "hello" && "<b> field "fname" </b>" and i got an error i tried several form and just instead put the user name it put like a text field fname in bold. Where is my mistake?

thanks again
greg

Re: changing answer style

Posted: Wed Dec 09, 2009 3:38 am
by sturgis
The tags have to be within quotes.

answer "some text here <b>" && field "the field" && "</b>"

Re: changing answer style

Posted: Wed Dec 09, 2009 4:54 pm
by greggarcia
Sturgis you are the man, now is working i just put like this
answer "Hola" && "<b>" && field "fNombre2" && "</b>" && "el resultado es...." && tResult titled "Y la respuesta es........"

i now i will play around with other text style, i am not a contributor now in this forum but give another couple months and you wil see, :D


thanks a lot
greetings
Greg

Re: changing answer style

Posted: Wed Dec 09, 2009 7:51 pm
by greggarcia
wow now i am available to change size, color, font, etc using structure as html.
thanks Sturgis

Re: changing answer style

Posted: Wed Dec 09, 2009 7:57 pm
by sturgis
Glad to help. :)

Re: changing answer style

Posted: Wed Dec 09, 2009 9:08 pm
by Mark
Hi,

Just to be on the safe side, you might want to start your answer text with <p> and finish it with </p> to make sure that the scripts in the answer dialog recognise your text as html code.

Best,

Mark

Re: changing answer style

Posted: Wed Dec 09, 2009 11:50 pm
by greggarcia
Thanks Mark i will do it.