[ASP] If "string" = empty

Pagina: 1
Acties:

  • RupS
  • Registratie: Februari 2001
  • Laatst online: 30-08 20:49
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<%
If "testdd" = empty then
    Response.Write("")
else
%>
    <table align=center cellspacing=0 width=300>
    <tr>
        <td align=center bgcolor="#AAAAAA">
            <font face="verdana" color="#FFFFFF" size=3>
            <%
                Response.Write("U koos voor: " & Request.form("testdd") & " optie . . .")
            %>
            </font>
        </td>
    </tr>
    </table>
    <br>
    <br>
    <br>
<%
End If
%>

Ik heb dus deze code...
Het werkt perfect, op 1 dingetje na:

Hij laat het stukje "u koos voor code" altijd zien...
Die variabele komt uit een form, en werkt ook als ik wel ergens voor kies...

Maar omdat het in dezelfde file staat, wil ik het alleen laten zien als iemand daadwerkelijk iets doet met het form.

Het lijkt wel alsof hij het if statement gewoon overslaat, en ik snap dus niet waarom... aAls ik:
if "testdd" = "" then
doe, werkt het ook niet...

Iemand een idee?

Zal wel weer supersimpel zijn, maar ik staar me er al anderhalf uur blind op.....

  • Jaspertje
  • Registratie: September 2001
  • Laatst online: 17-09 14:44

Jaspertje

Max & Milo.. lief

moet je niet gebruiken if request("testid")="" then...

  • dusty
  • Registratie: Mei 2000
  • Laatst online: 21-02 00:06

dusty

Celebrate Life!

de string "testdd" is om een of andere reden altijd gevuld. Ook heel toevallig altijd met 6 karakters, dus is het ook nooit empty dus doet hij altijd het andere stuk.

Het is alsof je doet : if 1=2 then .... is namelijk ook nooit waar.

Back In Black!
"Je moet haar alleen aan de ketting leggen" - MueR


  • RupS
  • Registratie: Februari 2001
  • Laatst online: 30-08 20:49
Hmmmmm, dat bedoel ik dus...

Staar ik me anderhalf uur blind, terwijl het logischer is dan logisch...

Thanx dus..

k, soz voor het topic, maar ut werkt nu :)

  • Annie
  • Registratie: Juni 1999
  • Laatst online: 25-11-2021

Annie

amateur megalomaan

Het is alsof je doet : if 1=2 then .... is namelijk ook nooit waar.
ook niet bij heeeele grote waarden van 1 ? ;)

Today's subliminal thought is:


  • raptorix
  • Registratie: Februari 2000
  • Laatst online: 17-02-2022
If isnull(blaat) then
response.write("het is leeg")
else
response.write("het is niet leeg")

  • Crazy D
  • Registratie: Augustus 2000
  • Laatst online: 16:47

Crazy D

I think we should take a look.

Of eventueel If Len(blaat) = 0 Then...

Exact expert nodig?


  • PhoneTech
  • Registratie: Mei 2000
  • Laatst online: 16-09 15:46
Of
code:
1
If isEmpty(blaat) then
Pagina: 1