DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Updating Fields only in a web page!

  1. #1
    Sanjay Patel Guest

    Updating Fields only in a web page!


    Dear Colleagues:

    I am new to Web Design/Development. I have been programming in C, C++
    and FoxPro for over 8+ years. What I enjoyed during those years is
    simplicity of designing UI( User Interface). I am having bit difficulty
    with UI in my web design/development. I hope you'll help me with my
    problem described below. Should I failed to explain my problem properly
    feel free to contact me: Sanjay@ArtisanSystems.Com

    PROBLEM:

    I am creating simple customer web page. When this page is displayed first
    time to end-user it has following fields:

    Customer ID
    First Name
    Last Name
    Policy Number
    Date Begin
    Date Expire

    This page supposed to take customer ID as input. Upon entering Customer
    ID
    end-user will press Search Button. This search button will initiate data
    base query. Once query is returned I have the remining fields.

    REAL PROBLEM BEGIN HERE:

    Now, that I have the result. I want to UPDATE the same page that is
    already displayed to end-user by simply POPULATING remaining fields.

    I can't seem to figure out how? Please someone explain me how I can do this?
    An example would really help me.

    Again, should you have specific question on my problem and would like to
    contact me: Sanjay@ArtisanSystems.Com or (404) 964-5257.

    P.S. If I need to user specific software/tools i.e. XML, JSP or whatever,
    then please specify that too.

    Sincerely,
    Sanjay Patel




  2. #2
    Oleg Buryak Guest

    Re: Updating Fields only in a web page!

    > Now, that I have the result. I want to UPDATE the same page that is
    > already displayed to end-user by simply POPULATING remaining fields.


    You can not UPDATE the same page. You can RELOAD the same template of the
    page with new data.
    Read more about it at
    http://www.wdvl.com/Authoring/Langua...eb/index4.html
    (Perl issue)

    --
    Oleg Buryak
    buria@perelom.com
    http://www.perelom.com ::: Offshore Web Design




  3. #3
    Russell Jones Guest

    Re: Updating Fields only in a web page!

    You can use remote scripting or (IE only) the XMLHTTPRequest object to make
    a background request for data. That will let you populate the fields without
    changing pages.

    Russell Jones
    Sr. Web Development Editor
    DevX.com

    "Sanjay Patel" <Sanjay@ArtisanSystems.Com> wrote in message
    news:3a8adac9$1@news.devx.com...
    >
    > Dear Colleagues:
    >
    > I am new to Web Design/Development. I have been programming in C, C++
    > and FoxPro for over 8+ years. What I enjoyed during those years is
    > simplicity of designing UI( User Interface). I am having bit difficulty
    > with UI in my web design/development. I hope you'll help me with my
    > problem described below. Should I failed to explain my problem properly
    > feel free to contact me: Sanjay@ArtisanSystems.Com
    >
    > PROBLEM:
    >
    > I am creating simple customer web page. When this page is displayed first
    > time to end-user it has following fields:
    >
    > Customer ID
    > First Name
    > Last Name
    > Policy Number
    > Date Begin
    > Date Expire
    >
    > This page supposed to take customer ID as input. Upon entering Customer
    > ID
    > end-user will press Search Button. This search button will initiate data
    > base query. Once query is returned I have the remining fields.
    >
    > REAL PROBLEM BEGIN HERE:
    >
    > Now, that I have the result. I want to UPDATE the same page that is
    > already displayed to end-user by simply POPULATING remaining fields.
    >
    > I can't seem to figure out how? Please someone explain me how I can do

    this?
    > An example would really help me.
    >
    > Again, should you have specific question on my problem and would like to
    > contact me: Sanjay@ArtisanSystems.Com or (404) 964-5257.
    >
    > P.S. If I need to user specific software/tools i.e. XML, JSP or whatever,
    > then please specify that too.
    >
    > Sincerely,
    > Sanjay Patel
    >
    >
    >




  4. #4
    aditee Guest

    Re: Updating Fields only in a web page!


    Hi Sanjay,

    This is actually quite simple to do, No you do not need any Specific Tools
    Only ASP is enough along with HTML.


    This is how your code would look, Please note that I am showing you this
    only for two fields FirstName and LastName the rest you can do on your own,
    Also, I am using VBScript as the Scripting language,


    <%@ language=VBSCript
    <HTML>
    <head>

    <%

    Dim fname,lname

    if request("custid") <> "" Then
    ' This makes sure that the folwoing code is executed only if there is some
    value in the custid.


    set conn = server.CreateObject ("adodb.connection")
    conn.Open "DSN=DSNAME" ' this is ODBC you can also use OLEDB
    set rs= server.CreateObject ("adodb.connection")

    sql = " select * from tablename where fieldname = " & request("custid")
    rs.open sql, conn

    if not rs.eof then
    fname = rs.fields("firstname").value
    lname = rs.fields("lastname").value

    end if

    end if

    end if
    %>

    </head>
    <body>
    <form name=frm1 id=frm1>

    Cutomer ID : <input type=text name=custid id=custid>
    FirstName : <input type=text name=custid id=custid value=<%= Fname %>>
    LastName : <input type=text name=custid id=custid value=<%= Lname %>>
    <input type=submit Value = SUBMIT>

    </form>

    </body>
    </html>


    And that's it.


    Regards,
    Aditee


    "Sanjay Patel" <Sanjay@ArtisanSystems.Com> wrote:
    >
    >Dear Colleagues:
    >
    >I am new to Web Design/Development. I have been programming in C, C++
    >and FoxPro for over 8+ years. What I enjoyed during those years is
    >simplicity of designing UI( User Interface). I am having bit difficulty
    >with UI in my web design/development. I hope you'll help me with my
    >problem described below. Should I failed to explain my problem properly
    >feel free to contact me: Sanjay@ArtisanSystems.Com
    >
    >PROBLEM:
    >
    >I am creating simple customer web page. When this page is displayed first
    >time to end-user it has following fields:
    >
    >Customer ID
    >First Name
    >Last Name
    >Policy Number
    >Date Begin
    >Date Expire
    >
    >This page supposed to take customer ID as input. Upon entering Customer
    >ID
    >end-user will press Search Button. This search button will initiate data
    >base query. Once query is returned I have the remining fields.
    >
    >REAL PROBLEM BEGIN HERE:
    >
    >Now, that I have the result. I want to UPDATE the same page that is
    >already displayed to end-user by simply POPULATING remaining fields.
    >
    >I can't seem to figure out how? Please someone explain me how I can do

    this?
    >An example would really help me.
    >
    >Again, should you have specific question on my problem and would like to
    >contact me: Sanjay@ArtisanSystems.Com or (404) 964-5257.
    >
    >P.S. If I need to user specific software/tools i.e. XML, JSP or whatever,
    >then please specify that too.
    >
    >Sincerely,
    >Sanjay Patel
    >
    >
    >



  5. #5
    Peter Guest

    Re: Updating Fields only in a web page!


    A few comments to save you some trouble.
    Also this solution assumes the following.
    IIS, SQL server, VBScript, WindowNT OS and you are familiar with server/client
    side ASP programming, ADO and SQL syntax.

    Corrections:

    ><%@ language=VBSCript


    Needs a Closing Tag, and Option Explicit is always a good programming practice.

    <%@ Language=VBScript %>
    <%Option Explicit%>

    >set rs= server.CreateObject ("adodb.connection")


    This should be
    rs = Server.CreateObject("ADODB.Recordset");

    Your connection works better and is easier to maintain using a connection
    string, and using the latest SQL Provider.

    sConnString ="Provider=SQLOLEDB.1;" & _
    "Data Source=" & sServer & ";" & _
    "Initial Catalog=" & sDBName & ";" & _
    "User ID=" & sUser & ";" & _
    "Password=" & sPassword & ";"
    Conn.Open (sConnString)

    There are a lot of technologies used in this example. Based on your statement
    about being new to this environment, I recommend some preliminary research
    on Active Server Pages and Scripting, before jumping into any simple solutions.

    Best of luck,
    Peter

    "aditee" <aditeegupte@chequemail.com> wrote:
    >
    >Hi Sanjay,
    >
    >This is actually quite simple to do, No you do not need any Specific Tools
    >Only ASP is enough along with HTML.
    >
    >
    >This is how your code would look, Please note that I am showing you this
    >only for two fields FirstName and LastName the rest you can do on your own,
    >Also, I am using VBScript as the Scripting language,
    >
    >
    ><%@ language=VBSCript
    ><HTML>
    ><head>
    >
    ><%
    >
    >Dim fname,lname
    >
    >if request("custid") <> "" Then
    >' This makes sure that the folwoing code is executed only if there is some
    >value in the custid.
    >
    >
    >set conn = server.CreateObject ("adodb.connection")
    >conn.Open "DSN=DSNAME" ' this is ODBC you can also use OLEDB
    >set rs= server.CreateObject ("adodb.connection")
    >
    >sql = " select * from tablename where fieldname = " & request("custid")
    >rs.open sql, conn
    >
    > if not rs.eof then
    > fname = rs.fields("firstname").value
    > lname = rs.fields("lastname").value
    >
    > end if
    >
    >end if
    >
    >end if
    >%>
    >
    ></head>
    ><body>
    ><form name=frm1 id=frm1>
    >
    >Cutomer ID : <input type=text name=custid id=custid>
    >FirstName : <input type=text name=custid id=custid value=<%= Fname %>>
    >LastName : <input type=text name=custid id=custid value=<%= Lname %>>
    ><input type=submit Value = SUBMIT>
    >
    ></form>
    >
    ></body>
    ></html>
    >
    >
    >And that's it.
    >
    >
    >Regards,
    >Aditee
    >
    >
    >"Sanjay Patel" <Sanjay@ArtisanSystems.Com> wrote:
    >>
    >>Dear Colleagues:
    >>
    >>I am new to Web Design/Development. I have been programming in C, C++
    >>and FoxPro for over 8+ years. What I enjoyed during those years is
    >>simplicity of designing UI( User Interface). I am having bit difficulty
    >>with UI in my web design/development. I hope you'll help me with my
    >>problem described below. Should I failed to explain my problem properly
    >>feel free to contact me: Sanjay@ArtisanSystems.Com
    >>
    >>PROBLEM:
    >>
    >>I am creating simple customer web page. When this page is displayed first
    >>time to end-user it has following fields:
    >>
    >>Customer ID
    >>First Name
    >>Last Name
    >>Policy Number
    >>Date Begin
    >>Date Expire
    >>
    >>This page supposed to take customer ID as input. Upon entering Customer
    >>ID
    >>end-user will press Search Button. This search button will initiate data
    >>base query. Once query is returned I have the remining fields.
    >>
    >>REAL PROBLEM BEGIN HERE:
    >>
    >>Now, that I have the result. I want to UPDATE the same page that is
    >>already displayed to end-user by simply POPULATING remaining fields.
    >>
    >>I can't seem to figure out how? Please someone explain me how I can do

    >this?
    >>An example would really help me.
    >>
    >>Again, should you have specific question on my problem and would like to
    >>contact me: Sanjay@ArtisanSystems.Com or (404) 964-5257.
    >>
    >>P.S. If I need to user specific software/tools i.e. XML, JSP or whatever,
    >>then please specify that too.
    >>
    >>Sincerely,
    >>Sanjay Patel
    >>
    >>
    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center