Ask a Question related to ASP Database, Design and Development.
-
Roji. P. Thomas #1
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
-
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... -
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... -
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... -
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... -
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... -
MyaTiX #2
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?
("task") ?>-----Original Message----->Where this variable is defined?>>select case task
>Dont you have to explicitly specify Request.Formmessage>
>
>
>--
>Roji. P. Thomas
>SQL Server Programmer
>--------------------------------------
>"MyaTiX" <anonymous@discussions.microsoft.com> wrote ininput>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 beit>> into the field but the user has the ability to changeinitial>> if needed.
>>
>> Can someone tell me why this might not work! thevalue.>> 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 newtaxamt>>
>> 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 = " && rs>> & ", " &_
>> "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 = ">>> ("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
-
Bob Barrows #3
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----->> Where this variable is defined?>>> select case task
>> 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
-
TomB #4
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



Reply With Quote

