| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
(2x) If Result = ... Then ... Else ...
Hi there,
Thanks to 'NoFriends' my bookcatalog-script is almost ready. See for that: http://forums.aspfree.com/showthread.php?t=45304 But I'd like to add one extra function to the search-script: when the script runs through the database it will display the results into HTML-tables, sorted by category. I want to make a function that when the result Categorie is similiar to "Revue der Sporten" or "Sport in Beeld", it will display the Dutch word "Uitgever" between the <td> tags. But when the result Categorie is similiar to "tijdschriften" it has to display the word "Nummer" between the <td> tags. And when none of the above 2 cases matches the result, it has to display the word "Auteur" between the <td> tags. 'NoFriends' already made an example for me, but suggested to post it here for any other ideas. This sample only works for one 'If Result-tag' and an '<% else %>' tag. So I'd ask you how to combine the two pieces of script below. Code:
************
<% if Results("Categorie") = "Revue der Sporten" or "Sport in Beeld" then %>
<td width="20%" height="20" valign="top">
<font color="#888888"><b>Uitgever</b></font>
</td>
<% else %>
<td width="20%" height="20" valign="top">
<font color="#888888"><b>Auteur</b></font>
</td>
<% end if %>
************
<% if Results("Categorie") = "tijdschriften" then %>
<td width="20%" height="20" valign="top">
<font color="#888888"><b>Nummer</b></font>
</td>
<% else %>
<td width="20%" height="20" valign="top">
<font color="#888888"><b>Auteur</b></font>
</td>
<% end if %>
************
Hope someone has the solution, thnx for help. Best regards, Bart Stens, The Netherlands |
|
#2
|
||||
|
||||
|
Hi Bart,
try using this, it should sort out your problem: Code:
************
<% if Results("Categorie") = "Revue der Sporten" or "Sport in Beeld" then %>
<td width="20%" height="20" valign="top">
<font color="#888888"><b>Uitgever</b></font>
</td>
<% elseif Results("Categorie") = "tijdschriften" then %>
<td width="20%" height="20" valign="top">
<font color="#888888"><b>Nummer</b></font>
</td>
<% else %>
<td width="20%" height="20" valign="top">
<font color="#888888"><b>Auteur</b></font>
</td>
<% end if %>
************
Regards noFriends |
|
#3
|
|||
|
|||
|
Thnx NoFriends,
I already found that out yesterday, when I saw a post of you in another thread, which I used as a guide. Plz. have a look at my first thread, the last post, which is my final and last problem with the bookcatalog-script. Regards, Bart Stens |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > (2x) If Result = ... Then ... Else ... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|