Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400

    Mancato recupero dei valori di un form

    Ciao.

    Potreste spiegarmi perchè questo form non restituisce nulla alla pagina che lo processa?:

    codice:
    <html>
    
    <head>
    <script language="javascript">
    <!--
    
    function Apri(pagina)
    {
      var w = 800;
      var h = 800;
      
      var pw = Math.floor((screen.width - w) / 2);
      var ph = Math.floor((screen.height - h) / 2);
    
     popup = window.open(pagina, "scelte", "scrollbars=yes, toolbar=no, width=" + w + ",height=" + h + ",top=" + ph + ",left=" + pw);
    
    }
     
    //-->
    </script>
    </head>
    
    <body>
    <FORM name="Qform" method="post" onSubmit="Apri('page.asp');return false">
    
    ....
    
    <INPUT type="hidden" name="QUEST_ID" value="<%=(rsQuest.Fields.Item("QUEST_ID").Value)%>">
    <INPUT type="hidden" name="QUEST_DATED" value="<%=(rsQuest.Fields.Item("QUEST_DATED").Value)%>">
    
    <INPUT name="ANS_ID" type="radio" class="form" value="<%=(rsQuest.Fields.Item("ANS_ID").Value)%>" checked> 
    
    <INPUT type="submit" class="form" value="Clicca qui">
    
    </FORM>
    </body>
    
    </html>
    page.asp

    codice:
    response.write Request.Form("QUEST_ID") &"
    "& _
                   Request.Form("QUEST_DATED") &"
    "& _
                   Request.Form("ANS_ID") &"
    "& _
    response.end

  2. #2
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Non riesco e non capisco dove sbaglio...

    Il valore del campo previsto nel form come "radio" name="ANS_ID" restituisce undefined...

    codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    
    <%
    Dim rsQuest
    Dim rsQuest_numRows
    set rsQuest = Server.CreateObject("ADODB.Recordset")
    rsQuest.ActiveConnection = objconn
    rsQuest.Source = "SELECT * FROM TBL_POLL_QUESTIONS, TBL_POLL_ANSWERS WHERE QUEST_ID = ANS_QUESTION AND QUEST_ACTIVE=1"
    rsQuest.CursorType = 0
    rsQuest.CursorLocation = 2
    rsQuest.LockType = 3
    rsQuest.Open()
    rsQuest_numRows = 0
    
    Dim rsQuest__numRows
    Dim rsQuest__index
    
    rsQuest__numRows = -1
    rsQuest__index = 0
    rsQuest_numRows = rsQuest_numRows + rsQuest__numRows
    
    %>
     
    <html> 
    <head> 
    <script> 
    function passaValori() 
    { 
    var w = 800; 
    var h = 350; 
    var ANS_ID = document.vote.ANS_ID.value 
    var QUEST_ID = document.vote.QUEST_ID.value 
    var QUEST_DATED = document.vote.QUEST_DATED.value
    var l = Math.floor((screen.width-w)/2); 
    var t = Math.floor((screen.height-h)/2); 
    window.open("2.asp?ANS_ID="+ANS_ID+"+QUEST_ID="+QUEST_ID+"+QUEST_DATED="+QUEST_DATED, "", "width=" + w + ",height=" + h + ",top=" + t + ",left=" + l );
    
    } 
    </script> 
    <title>Documento senza titolo</title> 
    </head> 
    
    <body> 
    <form name="vote" method="post"> 
    
    <INPUT type="hidden" name="QUEST_ID" value="<%=(rsQuest.Fields.Item("QUEST_ID").Value)%>">
    <INPUT type="hidden" name="QUEST_DATED" value="<%=(rsQuest.Fields.Item("QUEST_DATED").Value)%>">
    
    <%
    While ((rsQuest__numRows <> 0) AND (NOT rsQuest.EOF)) 
    %>
    
    <INPUT name="ANS_ID" type="radio" class="form" value="<%=(rsQuest.Fields.Item("ANS_ID").Value)%>" checked>
    <%=(rsQuest.Fields.Item("ANS_ANSWER").Value)%> 
    
     <%
     
      rsQuest__index=rsQuest__index+1
      rsQuest__numRows=rsQuest__numRows-1
      rsQuest.MoveNext()
      
    Wend
    %>
    
    <input type="submit" name="vai" value="vai" onclick="passaValori();return false"> 
    
    </form> 
    </body> 
    
    <%
    rsQuest.Close()
    Set rsQuest = Nothing
    %>
    </html>

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.