SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    ny
    Posts
    560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question checkbox and select box.

    Hola fellow programmers.
    This code is driving me wal nut..I am trying insert the data into a db but somehow it is not swicthing btw v1 and v2 variables. Form.occ is dynamically populated checkboxes and Form.Vr12H8H is dynamically populated select boxes..
    any help willl be app..


    =====================

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <link href="css/main.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/javascript" src="js/main.js"></script>
    <style type="text/css">
    <!--
    .style1 {font-family: Arial, Helvetica, sans-serif}
    .style3 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: bold;
    }
    .style4 {
    font-size: 14px;
    font-weight: bold;
    color: #FF9933;
    }
    .style6 {font-size: 12px}
    -->
    </style>
    </head>

    <body>


    <CFQUERY NAME="SingleQuery" DATASOURCE="#FormVector#">
    select genbid_assignmentinfo.facname
    , genbid_assignmentinfo.facsch
    , genbid_bidresult.lastname
    , genbid_bidresult.firstname
    , genbid_bidresult.homefac
    , genbid_assignmentinfo.facspot
    , genbid_assignmentinfo.facid

    from genbid_assignmentinfo
    left
    join genbid_bidresult
    on genbid_bidresult.facsch = genbid_assignmentinfo .facsch
    and genbid_bidresult.facname = genbid_assignmentinfo .facname
    and genbid_bidresult.factype = 'SGT'
    order
    by genbid_assignmentinfo .facname
    , genbid_assignmentinfo .facsch
    , genbid_bidresult.lastname
    , genbid_bidresult.firstname
    </CFQUERY>


    <cfquery name="gethomefac" datasource="#FormVector#">
    select facid,facname
    from genbid_facility

    order by facname
    </cfquery>



    <form method="post">
    <table width="650px" border="0" align="center" cellpadding="2" cellspacing="2" class="graytableborder">

    <CFOUTPUT QUERY="SingleQuery" GROUP="facname">

    <tr>
    <td height="78" align="center" valign="middle" bgcolor="##CCCCCC"><span class="style3">#facname#</span></td>
    <CFOUTPUT GROUP="facsch">
    <td align="left" valign="top"><span class="style1"><span class="style4">#facsch#</span><br />
    <span class="style6">

    <cfset i=0>

    <cfif #firstname# neq "">
    <cfoutput>

    <input type="checkbox" name="Occ" value="#facname#|#facsch#|#facid#|#i#<cfif facname eq "VR">|#homefac#</cfif>"><cfif facname eq "VR">#homefac#</cfif>- #firstname# #lastname#<br />

    <cfset i=i+1>
    </cfoutput>
    </cfif>


    <cfset fs=#facspot#-#i#>
    <cfloop index="b" from="1" to="#fs#">
    <input type="checkbox" name="Occ" value="#facname#|#facsch#|#facid#|#b##i#<cfif facname eq "VR"><cfif #homefac# neq "">|#homefac#</cfif></cfif>">

    <cfif facname neq "VR">
    Open Spot<br />
    <cfelse>
    <cfset fid=#facid#>
    <select name="Vr12H8H" >
    <option value=""></option>
    <cfloop query="gethomefac">
    <option value="#facname#">#facname#</option>
    </cfloop>
    </select><br />
    </cfif>

    </cfloop>
    </span></span>

    </td>


    </CFOUTPUT>

    </tr>
    <tr><td><hr size="0.5" noshade="noshade" color="##99CC00"/></td><td colspan="6"><hr size="0.5" noshade="noshade" color="##99CC00"/></td></tr>

    </CFOUTPUT>
    </table>
    <center><input type="submit" class="button" id="sb" name="sb" value="Submit"></center>

    </form>

    <cfif isdefined('Form.sb')>
    <cfif isdefined('Form.Occ') >
    <cfset v2=""><cfset v3="">
    <cfloop list="#Form.Occ#" index="f">

    <cfset v1=#listgetat(f,3,"|")#>


    <cfif #listlen(f,"|")# eq 5 >
    <cfset v2=#listgetat(f,5,"|")#>

    </cfif>
    <!---cfif #Form.Vr12H8H# neq "" and #v2# eq "">
    <cfset i=1>
    <cfset v3=#listgetat(Form.Vr12H8H,i)#>
    <cfset i=i+1>
    </cfif--->

    <cfoutput>#v3# v2:#v2#</cfoutput><cfabort>
    <cfquery name="InsertD" datasource="#FormVector#">
    insert into genbid_assignmenttemp
    (facid,spot,homefac,status,tid)
    values(
    '#v1#',
    1,
    <cfif v2 neq "">'#v2#',<cfelse>'#v3#',</cfif>
    'Y',
    genbid_assignmenttempseq.nextval
    )
    </cfquery>



    </cfloop>


    </cfif>



    </cfif>


    </body>
    </html>

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Without posting lots of code, can you explain what it is you're trying to accomplish? Do you have an online example that we can view?
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    ny
    Posts
    560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry

    pls see the attachment
    Attached Files Attached Files

  4. #4
    SitePoint Wizard mcsolas's Avatar
    Join Date
    Jul 2004
    Location
    Hermosa Costa Rica
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •