Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Submit button and reset button don't work

Posted on 2004-03-31
2
Medium Priority
?
1,123 Views
Last Modified: 2008-03-06
Hi!

I have a asp page with a form that's supposed to send values to another asp page that inserts records in a database. The problem is that the form doesn't seem to work. When I click the submit button (or the reset button) nothing happens. I can't figure out why.

Posting the code here even if it's a lot.

MaB

--------------------------------------------------------------------------
<%@ Language=VBScript %>

<%
Dim Databas, strConn
Set Databas = Server.CreateObject ("ADODB.Connection")

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\m02s009\atnetdb$\n\ny\frv1.mdb"

input_datum = Now()

'START - Per Andersson TE, 2003-10-16
'öppna connection
Databas.Open strConn

UserAccount = Request.ServerVariables("LOGON_USER")
lngLen = len(UserAccount)
lngPos = InStr(1, UserAccount, "\", vbTextCompare)
If lngPos <> 0 Then
   UserAccount = Mid(UserAccount, lngPos + 1, lngLen - lngPos)
End If

v_user = false  
SQLstr = "SELECT * FROM Anst WHERE konto = '" & UserAccount & "'"
set poster = Databas.execute(SQLstr)

if poster.eof then
   v_user = false
else
   v_user = true
end if      
'STOP - Per Andersson TE, 2003-10-16
%>

<html>
<head>
<title>Ny frånvaro</title>
<link rel="stylesheet" type="text/css" href="../../stylesheets/frv.css">
<base target="_self">
</head>

<body>
<h1>Lägg till frånvaro!</h1>
<div id="div3"
<form action="RegistreraFrvIDB.asp" method="post">
<%
   if v_user = true then
%>                  

<table cellspacing=10 cellpadding=0 align=left border=0 style="border-collapse: collapse" bordercolor="#111111">
    <tr valign=top>
      <td colspan="2"><b>Uppgifter markerade med * &auml;r obligatoriska.</b></td>
    </tr>
    <tr valign=top>
      <td width="76" height="38" style="border-left-width: 1; border-right-style: inset; border-right-width: 1; border-top-width: 1; border-bottom-width: 1">
        <div align="right"> <span lang="sv">Plats/Orsak</span>&nbsp;</div>
      </td>
      <td>
        <input type="hidden" name="anstID" value="<%=poster("anstID")%>">
        <select size="1" name="Lokal">
        <%
        SQLstr = "SELECT * FROM Lokal ORDER BY lnamn"
        set posts = Databas.execute(SQLstr)
        Do Until posts.EOF%>
            <option><%=posts("beteckn")%></option>
        <%
        posts.MoveNext
        loop
        %>
        </select>
        <select size="1" name="Orsak">
        <%
        SQLstr = "SELECT * FROM Orsak ORDER BY frvOrsak"
        set post = Databas.execute(SQLstr)
        Do Until post.EOF%>
            <option><%=post("frvOrsak")%></option>
        <%
        post.MoveNext
        loop
        %>
        </select>&nbsp;<i>(Du måste
        ange en orsak ELLER en beskrivning)</i></td>
    </tr>
    <tr valign="top">
      <td width="76" height="22" style="border-left-width: 1; border-right-style: inset; border-right-width: 1; border-top-width: 1; border-bottom-width: 1">
        <div align="right"><span lang="sv">Beskrivning</span>&nbsp;</div>
      </td>
      <td>
        <textarea rows=7 size=25 name="description" value="" cols="39"> </textarea>
        <br>
        <input type="checkbox" name="privat" value="0">
        <b>Visa beskrivningen endast för mig!</b></td>
      </tr>
   <input type="hidden" name="namn" value="<%=UserAccount%>">
   
<%if poster("mail") = "" then%>
      <tr valign=top>
   <td width="76" height="22" style="border-left-width: 1; border-right-style: inset; border-right-width: 1; border-top-width: 1; border-bottom-width: 1">
        <div align="right">E-post&nbsp;</div>
      </td>
      <td>
        <input type="text"  name="mail" value="" size="40">
      </td>
      </tr>
    <%end if%>
    <tr valign=top>
      <td width="76" height="45" style="border-left-width: 1; border-right-style: inset; border-right-width: 1; border-top-width: 1; border-bottom-width: 1">
        <div align="right">
         * <span lang="sv">Start</span> &nbsp;
        </div>
      </td>
      <td>år
        <input type="text" size="5" name="startar" value="<%=Year(input_datum)%>">
      mån
        <input type="text" maxlength=2 size=3 name="startmanad" value="<%=Month(input_datum)%>">
        dag
        <input type="text" maxlength=2 size=3 name="startdag" value="<%=Day(input_datum)%>">
        timme
        <input type="text" maxlength=2 size=3 name="starttimme" value="<%=DatePart("h",input_datum,0,0)%>">
        minut
        <input type="text" maxlength=2 size=3 name="startminut" value="<%=DatePart("n",input_datum,0,0)%>">
        <font color="#FF3333">&nbsp;</font> <br>
        &nbsp;</td>
    </tr>
    <tr valign=top>
      <td width="76" height="45" style="border-left-width: 1; border-right-style: inset; border-right-width: 1; border-top-width: 1; border-bottom-width: 1">
        <div align="right">
         * Slut &nbsp;
        </div>
      </td>
      <td>timme
        <input maxlength=2 size=3 name="sluttimme" value="">
        minut
        <input maxlength=2 size=3 name="slutminut" value="">
        <font color="#FF3333">&nbsp;</font> <br>
        &nbsp;</td>
    </tr>    <tr valign=top>
      <td width="77" height="26">
        <div align="right">&nbsp;</div>
      </td>
      <td>
        <input type="submit" value="Spara!" name="Submit"> <input type="reset" value="Rensa!" name="Reset"> <input type="button" value="Stäng!" onClick="javascript:window.close();"><%=UserAccount & " " & poster("anstID")%>
      </td>
    </tr>
  </table>
 </form>
</div>
<%

'START - Per Andersson TE, 2003-10-16
   else
%>
 
 <P><font face="Arial" size="2"><b>Du saknar behörighet!</b></font></P>
 
<%
   end if
%>
 

<%
'Rensa upp
poster.close
posts.close
post.close
set databas = Nothing

'SLUT - Per Andersson TE, 2003-10-16
%>

</body>
</html>
0
Comment
Question by:MaB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
appari earned 2000 total points
ID: 10723265
may its becoz div tag is not closed properly?

change(the line before <form...>
<div id="div3"

to

<div id="div3">

0
 
LVL 7

Author Comment

by:MaB
ID: 10723287
Thank you sooo much.

Knowing myself I was really looking for a typo, but just couldn't find it though I've been staring at the code for hours and hours. FrontPig isn't really helping out when it comes to typos.

Thanks again, now I can focus on the update database page.

BR MaB
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question