Visualizzazione dei risultati da 1 a 2 su 2

Discussione: problema condizione if

  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2002
    Messaggi
    379

    problema condizione if

    stat = request.form("stat")
    news = request.form("news")
    if stat <> 1 then
    stat2 = "no"
    if news <> 1 then
    news2 = "no"
    else
    if stat = 1 then
    stat2 = "si"
    if news = 1 then
    news2 = "si"
    end if
    end if
    end if
    end if


    alla fine se nel form non attivo i checkbox mi mette no nel database, invece se li attivo mi da questo errore:

    Microsoft VBScript runtime error '800a000d'
    Type mismatch: '[string: "on"]'
    StripMAN

  2. #2
    Utente di HTML.it
    Registrato dal
    Jan 2002
    Messaggi
    379
    ho risolto cosi':


    stat = request.form("stat")
    news = request.form("news")
    if stat <> "on" then
    stat2 = "no"
    else
    stat2 = "si"
    end if
    if news <> "on" then
    news2 = "no"
    else
    news2 = "si"
    end if
    StripMAN

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.