put your html in a string and use if statements,
String string1 = <first lot of text>
String string2 = <optional text 1>
String string3 = <optional text 2>
if (OrNot.equals(OR)) //assuming another string OrNot has the users response
{
string1 = string1 + string2
}
else
{
string1 = string 1 + string 3
}
Then write the string to the page
Alternatively you could create a loop to do something similar, this way you could create a variable number of fields.
|