พบกับบทความเกี่ยวกับคอมพิวเตอร์และ programming ได้ที่ http://articles.modoeye.com
ASP programming / sql กับ listbox
peary
peary
Mon 7 Jul 2008 00:24:00

อยากทราบว่าจะเก็บข้อมูลจาก listbox ลงใน database ยังไงเหรอคะ
ถ้าจะให้ดี เเถม radio button ด้วยก็จะขอบพระคุณค่ะ แหะๆ
อยากให้ช่วยอธิบายให้หน่อยค่ะ
ตอนนี้เขียน asp vbscript ค่ะ

webmaster
webmaster
Mon 7 Jul 2008 00:42:35
จำไม่ค่อยได้นะครับ ถ้า dropdown จะให้ค่าตามชื่อ object เลย
ส่วน radio จะค่าเป็น comma delimited value ครับ
peary
peary
Sat 12 Jul 2008 01:51:33

เพื่อนเค้าเเนะนำให้ดึงข้อมูลมาจากฐานดีกว่าคะ

<select name="selectType">
    <option value=''>[---โปรดระบุ---]</option>
          <%
     Set     BEDPConn = Server.CreateObject("ADODB.Connection")
     BEDPConn.Open"Driver={SQL Server};Server=server name;Database=database name;Uid=user name ;Pwd=password;"
     set ref1=server.CreateObject("ADODB.RECORDSET")       
     ref1.Open "select Type_Name from tableName  order by Type_ID",BEDPConn        
        do while not ref1.EOF
     %>
          
     <option value='<%=ref1("Type_Name")%>'><%=ref1("Type_Name")%></option>
                                        
       <%  
         ref1.MoveNext

        loop
       ref1.Close
       set ref1=nothing
       %>
                </select>

webmaster
webmaster
Sun 13 Jul 2008 02:30:58
ก่อนหน้านี้ถามเก็บข้อมูลจาก listbox ลงใน database ไม่ใช่หรือครับ
Reply
Name:
E-mail:
Home | Services | Forum | Classified | Directories | Support | Contact
ATOM feed RSS 0.9 feed RSS 1.0 feed RSS 2.0 feed
Copyright © 2005 - 2007 Modoeye.com, All Rights Reserved.
Disclaimer | Privacy policy | Term of Use | Term of Services
Valid XHTML Valid CSS! PHP: Hypertext Preprocessor MySQL database Apache Powered! FreeBSD Power to serve
Modoeye Sitemap Client login