Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: Form update problem

    >select case task
    Where this variable is defined?
    Dont you have to explicitly specify Request.Form("task") ?



    --
    Roji. P. Thomas
    SQL Server Programmer
    --------------------------------------
    "MyaTiX" <anonymous@discussions.microsoft.com> wrote in message
    news:069a01c3ba81$05d30990$a001280a@phx.gbl...
    > I have the following piece of asp in a form!
    >
    > What I want to happen is that the initial value be input
    > into the field but the user has the ability to change it
    > if needed.
    >
    > Can someone tell me why this might not work! the initial
    > value shows up but when I try to update it with a new
    > value it doesn't work. I don't get any errors it just
    > loads the initial value again rather than the new value.
    >
    > Thanks for any help!
    >
    >
    > <script>
    > function changetax () {
    > document.forma.task.value = "CT";
    > document.forma.submit ();
    > </script>
    > <%
    > select case task
    > case "CT"
    > taxamt = request("taxamt")
    > shipcost = request("shipcost")
    > surcharge = request("surcharge")
    > sql = "update tblprocurement set taxamt = " & taxamt
    > & ", " &_
    > "shipcost = " & shipcost & ", surcharge = " &
    > surcharge & " " &_
    > "where procid = '" & procid & "';"
    > set rs = conn.execute(sql)
    > if step > 0 then
    > relocate = "newwiz.asp"
    > end if
    >
    > sql = "select * from tblCurrency where CurrencyID = " & rs
    > ("CurrencyID") & ";"
    > set tmprs = conn.execute(sql)
    > TaxAmount = tmprs("TaxAmt")
    > %>
    > <input name="taxamt" value="<%=TaxAmount%>" size=3>
    > <input type="button" value="update changes"
    > onclick="javascript:changetax();">

    Roji. P. Thomas Guest

  2. Similar Questions and Discussions

    1. Update a table without using a form
      Is there a way to update a table without using a form? In my situation I receive a GET with a username. From that I query a table to get the...
    2. PHP-Highlight Form Update Changes
      PROBLEM: I have a rather lengthy user information update form. I'd like to either be able to email only the changes made by the user or else...
    3. Update Records form
      Dreamweaver MX 2004 ASP with VBasic I have a form page which passes a parameter to an update page. The parameter is passed for the first record...
    4. update form
      A value in an autonumber field is assigned by your database when the record is added to the table. It's not updateable, so you can't make use of...
    5. FORM LIVE UPDATE
      I am creating a page which has a number of forms, this page deals with accounts. The expensise are enetered in the relivatant forms and then they...
  3. #2

    Default Re: Form update problem

    The variable has been requested! I tried specifying
    request.form but this didn't help the situation!

    Has anyone got any other ideas?

    >-----Original Message-----
    >>select case task
    >Where this variable is defined?
    >Dont you have to explicitly specify Request.Form
    ("task") ?
    >
    >
    >
    >--
    >Roji. P. Thomas
    >SQL Server Programmer
    >--------------------------------------
    >"MyaTiX" <anonymous@discussions.microsoft.com> wrote in
    message
    >news:069a01c3ba81$05d30990$a001280a@phx.gbl...
    >> I have the following piece of asp in a form!
    >>
    >> What I want to happen is that the initial value be
    input
    >> into the field but the user has the ability to change
    it
    >> if needed.
    >>
    >> Can someone tell me why this might not work! the
    initial
    >> value shows up but when I try to update it with a new
    >> value it doesn't work. I don't get any errors it just
    >> loads the initial value again rather than the new
    value.
    >>
    >> Thanks for any help!
    >>
    >>
    >> <script>
    >> function changetax () {
    >> document.forma.task.value = "CT";
    >> document.forma.submit ();
    >> </script>
    >> <%
    >> select case task
    >> case "CT"
    >> taxamt = request("taxamt")
    >> shipcost = request("shipcost")
    >> surcharge = request("surcharge")
    >> sql = "update tblprocurement set taxamt = " &
    taxamt
    >> & ", " &_
    >> "shipcost = " & shipcost & ", surcharge = " &
    >> surcharge & " " &_
    >> "where procid = '" & procid & "';"
    >> set rs = conn.execute(sql)
    >> if step > 0 then
    >> relocate = "newwiz.asp"
    >> end if
    >>
    >> sql = "select * from tblCurrency where CurrencyID = "
    & rs
    >> ("CurrencyID") & ";"
    >> set tmprs = conn.execute(sql)
    >> TaxAmount = tmprs("TaxAmt")
    >> %>
    >> <input name="taxamt" value="<%=TaxAmount%>" size=3>
    >> <input type="button" value="update changes"
    >> onclick="javascript:changetax();">
    >
    >
    >.
    >
    MyaTiX Guest

  4. #3

    Default Re: Form update problem

    Not until you show the code where you assign a value to the task variable in
    your server-side script.

    Bob Barrows

    MyaTiX wrote:
    > The variable has been requested! I tried specifying
    > request.form but this didn't help the situation!
    >
    > Has anyone got any other ideas?
    >
    >
    >> -----Original Message-----
    >>> select case task
    >> Where this variable is defined?
    >> Dont you have to explicitly specify Request.Form ("task") ?
    >>
    >>
    >>
    >> --
    >> Roji. P. Thomas
    >> SQL Server Programmer
    >> --------------------------------------
    >> "MyaTiX" <anonymous@discussions.microsoft.com> wrote in message
    >> news:069a01c3ba81$05d30990$a001280a@phx.gbl...
    >>> I have the following piece of asp in a form!
    >>>
    >>> What I want to happen is that the initial value be input
    >>> into the field but the user has the ability to change it
    >>> if needed.
    >>>
    >>> Can someone tell me why this might not work! the initial
    >>> value shows up but when I try to update it with a new
    >>> value it doesn't work. I don't get any errors it just
    >>> loads the initial value again rather than the new value.
    >>>
    >>> Thanks for any help!
    >>>
    >>>
    >>> <script>
    >>> function changetax () {
    >>> document.forma.task.value = "CT";
    >>> document.forma.submit ();
    >>> </script>
    >>> <%
    >>> select case task
    >>> case "CT"
    >>> taxamt = request("taxamt")
    >>> shipcost = request("shipcost")
    >>> surcharge = request("surcharge")
    >>> sql = "update tblprocurement set taxamt = " & taxamt
    >>> & ", " &_
    >>> "shipcost = " & shipcost & ", surcharge = " &
    >>> surcharge & " " &_
    >>> "where procid = '" & procid & "';"
    >>> set rs = conn.execute(sql)
    >>> if step > 0 then
    >>> relocate = "newwiz.asp"
    >>> end if
    >>>
    >>> sql = "select * from tblCurrency where CurrencyID = " & rs
    >>> ("CurrencyID") & ";"
    >>> set tmprs = conn.execute(sql)
    >>> TaxAmount = tmprs("TaxAmt")
    >>> %>
    >>> <input name="taxamt" value="<%=TaxAmount%>" size=3>
    >>> <input type="button" value="update changes"
    >>> onclick="javascript:changetax();">
    >>
    >>
    >> .


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  5. #4

    Default Re: Form update problem

    Assuming there isn't more code missing (other than where task was assigned)

    you are running an update sql statement and setting the return value of that
    statement to the object rs. Since it's an update statement there is no
    return value.
    Thus, your second sql statement "SELECT ......... WHERE CurrencyID=" &
    rs("CurrencyID") resolves to....
    SELECT ...... WHERE CurrencyID=

    because rs is empty.



    "MyaTiX" <anonymous@discussions.microsoft.com> wrote in message
    news:069a01c3ba81$05d30990$a001280a@phx.gbl...
    > I have the following piece of asp in a form!
    >
    > What I want to happen is that the initial value be input
    > into the field but the user has the ability to change it
    > if needed.
    >
    > Can someone tell me why this might not work! the initial
    > value shows up but when I try to update it with a new
    > value it doesn't work. I don't get any errors it just
    > loads the initial value again rather than the new value.
    >
    > Thanks for any help!
    >
    >
    > <script>
    > function changetax () {
    > document.forma.task.value = "CT";
    > document.forma.submit ();
    > </script>
    > <%
    > select case task
    > case "CT"
    > taxamt = request("taxamt")
    > shipcost = request("shipcost")
    > surcharge = request("surcharge")
    > sql = "update tblprocurement set taxamt = " & taxamt
    > & ", " &_
    > "shipcost = " & shipcost & ", surcharge = " &
    > surcharge & " " &_
    > "where procid = '" & procid & "';"
    > set rs = conn.execute(sql)h
    > if step > 0 then
    > relocate = "newwiz.asp"
    > end if
    >
    > sql = "select * from tblCurrency where CurrencyID = " & rs
    > ("CurrencyID") & ";"
    > set tmprs = conn.execute(sql)
    > TaxAmount = tmprs("TaxAmt")
    > %>
    > <input name="taxamt" value="<%=TaxAmount%>" size=3>
    > <input type="button" value="update changes"
    > onclick="javascript:changetax();">

    TomB Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139