#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    NIG
    Posts
    4
    Rep Power
    0

    Question Concatenating Control buttons


    Hi All,

    I pls want a help in my piece of code, I am actually populating the form with data from an MS SQL Database, but I want to concatenate the firstname with the output been dispalyed in the Text Area. Below is my code;

    Thnaks
    Abd

    <%
    category = TRIM( Request.Form( "cat" ) )
    username = TRIM( Request.Form( "username" ) )



    IF username <> "" THEN
    Set Con = Server.CreateObject( "ADODB.Connection" )
    Con.Open "PROVIDER=SQLOLEDB;DATA SOURCE=ABD;UID=sa;PWD=abd;DATABASE=abdul"
    Set RS= Server.CreateObject( "ADODB.Recordset" )

    If category = "Globe" then
    RS.Open "select * from globe where phonenum = '" &username& "'", Con

    firstname = RS.Fields("firstname")
    lastname = RS.Fields("lastname")
    middlename = RS.Fields("middlename")
    homeadd = RS.Fields("homeadd")
    busadd = RS.Fields("busadd")
    terrifplan = RS.Fields("terrifplan")
    state = RS.Fields("state")
    phonenum = RS.Fields("phonenum")
    typeofpay = RS.Fields("typeofpay")
    assignedto = RS.Fields("assignedto")
    nservicereq = RS.Fields("nservicereq")
    //Comment = RS.Fields("Comment")



    End if
    Con.Close
    Set RS = Nothing
    Set Con = Nothing
    END IF
    %>


    <Html>
    <head><title>Return Data</title>

    </head>
    <body>



    <form name="form1" method="post" action="updcsr.asp?cate">

    &nbsp; <input type="text" id="globe2" value="Globe2" name="cate" readonly>

    <h1 align="center"><font color="blue" size=+2>Customer Demographic Information</font></h1>
    <br>
    <b>First Name:</b>
    &nbsp;<input name="FirstName" type="text" value="<%=Server.HTMLEncode(firstname)%>" readonly>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Last Name:</b>
    &nbsp;<input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(lastname)%>" readonly>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Middle Name:</b>
    &nbsp;<input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(middlename)%>" readonly>
    <p>
    <b>Home Address:</b>
    &nbsp;<input name="Address" type="text" size="17" value="<%=Server.HTMLEncode(homeadd)%>" readonly>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Business Address:</b>
    &nbsp;<input name="PositionCode" type="text" size="15" value="<%=Server.HTMLEncode(busadd)%>" readonly>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Tarrif Plan:</b>
    &nbsp;<input name="CandidateCode" type="text"value="<%=Server.HTMLEncode(terrifplan)%>" readonly>
    <p>
    <b>State:</b>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Address" type="text" value="<%=Server.HTMLEncode(state)%>" readonly>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue"><b>Phone Number:</b></font>
    &nbsp;<input name="PositionCode" type="text" size="18" value="<%=Server.HTMLEncode(phonenum)%>" readonly>
    <p>
    <b>Mode of Payment:</b>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Address" type="text" value="<%=Server.HTMLEncode(typeofpay)%>" readonly>

    <hr>

    <br>

    <%
    //Populating Text Area with an entire column data from the Database

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=ABD;UID=sa;PWD=abd;DATABASE=abdul"

    Set rs=Conn.execute("Select nservicereq from globe")
    Commnet = RS.Fields("nservicereq")

    response.write "<b>Service Reqst History:</b><br><TEXTAREA NAME='Comment' ROWS=5 COLS=80>"&vbcrlf
    while not rs.eof
    response.write ""&rs("nservicereq")&""&vbcrlf
    rs.movenext
    wend
    response.write "</TEXTAREA>"&vbcrlf
    rs.close
    set rs=nothing
    Conn.close
    set Conn=nothing
    %>


    <p align="center"><input type="submit" value="New Request">
    <p>

    </form>

    <SCRIPT LANGUAGE="JavaScript">

    //To Hide Globacom Textbox
    document.getElementById("globacom2").style.display = 'none'
    </SCRIPT>

    </body>
    </html>
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12
    I don't see the problem

    why not just add

    Response.write firstname

    after:

    while not rs.eof
    response.write ""&rs("nservicereq")&""&vbcrlf
    rs.movenext
    wend

    !

    My apologies if I miss-understood the question
    I hope this is of any help to anyone.

    Yassoor
    http://www.WebsitesCreation.ca

IMN logo majestic logo threadwatch logo seochat tools logo