7 Replies - 500 Views - Last Post: 11 January 2013 - 09:49 AM

#1 Panj27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-January 13

Html/asp Checkbox does not exist

Posted 10 January 2013 - 12:50 PM

I have page that allows user input (a job number) to view a table that generated from SQL. In one of the columns of that table, checkboxes are generated. I want to update the specific rows that are checked in the table but when I try to code something, it says either my connection (conn) to the server is undefined or that the checkbox is undefined. The code works fine up until a checkbox is selected (or if the checkbox is selected nothing happens). Any help is greatly appreciated thank you in advance. I can provide more code if necessary.

<body bgcolor =silver>

    <%
        Dim SI, qry, qry1, qry2, qry3, qry4, qry5, qry6, qry7, qry8
             
        SI = Request.Form("srch")
                
        qry = ("SELECT * FROM [EDIT_8-23-2012] WHERE [VBAK-VBELN] = '" & SI & "'")
        qry1 = ("SELECT * FROM [EDIT_11-3-2012] WHERE [VBAK-VBELN] = '" & SI & "'")
        qry2 = ("SELECT * FROM [EDIT_11-8-2012] WHERE [VBAK-VBELN] = '" & SI & "'")
        
        qry3 = ("UPDATE [EDIT_8-23-2012] SET [FI] = 'NO' WHERE [VBAK-VBELN] = '" & SI & "'")
        qry4 = ("UPDATE [EDIT_11-3-2012] SET [FI] = 'NO' WHERE [VBAK-VBELN] = '" & SI & "'")
        qry5 = ("UPDATE [EDIT_11-8-2012] SET [FI] = 'NO' WHERE [VBAK-VBELN] = '" & SI & "'")
        
        qry6 = ("UPDATE [EDIT_8-23-2012] SET [SO] = 'NO' WHERE [VBAK-VBELN] = '" & SI & "'")
        qry7 = ("UPDATE [EDIT_11-3-2012] SET [SO] = 'NO' WHERE [VBAK-VBELN] = '" & SI & "'")
        qry8 = ("UPDATE [EDIT_11-8-2012] SET [SO] = 'NO' WHERE [VBAK-VBELN] = '" & SI & "'")
                                 
        If SI = "H012531" Or SI = "R012726" Or SI = "F012664" Or SI = "F012358" Or SI = "L012785" Or SI = "H012859" Or SI = "H012679" Or SI = "V012670" Or SI = "R012726" Then
            
            RS = conn.Execute(qry)
            
    %>
    
    <table id="table1" border="2" width="135%" bordercolor=BLUE>
    <form name="form1" onsubmit="return checkCheckboxes(abc)">
         
    <% 
        
        For Each f In RS.Fields
            
            Response.Write("<td><b>" & f.Name & "</b></td>")
                        
        Next
    
            Do While Not RS.EOF
            
            Response.Write("<tr>")
        
            For Each f In RS.fields
                If f.name = "FI" Then
                    Response.Write("<td><br><input type=checkbox Name=CB1 value=CB1 runat=server onclick=conn.execute(qry3)>" & f.value & "</br></td>")
                                        
                ElseIf f.name = "SO" Then
                    Response.Write("<td><br><input type=checkbox name=CB1 value=b>" & f.value & "</br></td>")
                Else
                    Response.Write("<td><br>" & f.value & "</br></td>")
                End If
                
            Next
            
            RS.MoveNext()
                      
        Loop


This post has been edited by Dormilich: 10 January 2013 - 11:22 PM
Reason for edit:: fixed code tags


Is This A Good Question/Topic? 0
  • +

Replies To: Html/asp Checkbox does not exist

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3390
  • View blog
  • Posts: 9,577
  • Joined: 08-June 10

Re: Html/asp Checkbox does not exist

Posted 10 January 2013 - 11:24 PM

since you’ve posted in the HTML forum, what is the HTML output (as seen by the browser) of your code?
Was This Post Helpful? 0
  • +
  • -

#3 Panj27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-January 13

Re: Html/asp Checkbox does not exist

Posted 11 January 2013 - 08:04 AM

The output is a table that is generated from my database in sql. So if I enter job number 12345, a table that matches that job number will be generated and in one of the columns, checkboxes will be placed in each row. The checkboxes do not do anything though which is what my problem is.
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3390
  • View blog
  • Posts: 9,577
  • Joined: 08-June 10

Re: Html/asp Checkbox does not exist

Posted 11 January 2013 - 08:07 AM

since I can only assume that there’s nothing wrong with the HTML, should I move this thread to the C#/.NET/? forum?
Was This Post Helpful? 0
  • +
  • -

#5 Panj27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-January 13

Re: Html/asp Checkbox does not exist

Posted 11 January 2013 - 08:15 AM

If you think that is the right thing to do. I thought it belonged here because most of my code is in HTML and the checkbox i used is written in HTML but you would know better than I would.
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3390
  • View blog
  • Posts: 9,577
  • Joined: 08-June 10

Re: Html/asp Checkbox does not exist

Posted 11 January 2013 - 09:17 AM

so far I have not seen any HTML code, hence the question.
Was This Post Helpful? 0
  • +
  • -

#7 Panj27  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-January 13

Re: Html/asp Checkbox does not exist

Posted 11 January 2013 - 09:33 AM

It is mainly ASP but has some HTML as well.

<%  Response.Buffer = True%>

<%  
    Dim RS
    RS = Server.CreateObject("ADODB.RecordSet")
%>
    
<!DOCTYPE html PUBLIC>
<?xml version="1.0"?>
<%@ Page Language="VB" Debug="True" aspcompat="true"%>
<%@ Import Namespace="System.Data" %>


<html xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method='html'/>


<head> 

<title> Table Update </title>

<% 
    Dim conn
    conn = Server.CreateObject("ADODB.Connection")
    conn.open("DSN=;UID=;PWD=;DATABASE=") //"took out credentials"
%>

</head>
    
&nbsp;</head><form id="Formm" runat="server">

<label> Please Enter an Order Number to Update: </label>

<p>

<textarea name="srch" rows="1" cols="20" ></textarea>

</p>

<p>

<input type="submit" name="Submit" value="Display" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="Update" value="Update" onclick=""/>    
</p>

</form>


This post has been edited by Dormilich: 11 January 2013 - 09:47 AM

Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3390
  • View blog
  • Posts: 9,577
  • Joined: 08-June 10

Re: Html/asp Checkbox does not exist

Posted 11 January 2013 - 09:49 AM

maybe that ASP creates the problem in HTML? but as long as I do not see the code that the browser gets*, I cannot tell.


* - go to the browser > show source code > copy that here (only the table part)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1