Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 5th, 2004, 11:50 AM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Radio buttons on the ASP page

I have 2 radio buttons. It defaults to a value from the database
The user can change the radio button value and hit submit which
updates the value in the database. The problem is that the radio
button value does not get refreshed when the value is updated in the database.
The user has to come back to the same page to see the refreshed values.
Is there a way of refreshing the radio button values on the page
after it is changed.
 
Old October 5th, 2004, 12:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Could you post any relevant code? It's hard to see what is happening from your description.
 
Old October 5th, 2004, 12:56 PM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<form name = "openclosegates" method = "post">
                    <input id = radiogroup type="radio" name="RadioGroup" <%if orsopenclose.fields("QP_atquota") = 0 then %> checked <% end if%> VALUE="0">&nbsp; Open&nbsp;Gates&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <INPUT id = radiogroup1 type="radio" name="RadioGroup" <%if orsopenclose.fields("QP_atquota") = 1 then %> checked <% end if%> VALUE="1">Close Gates &nbsp;<br><br>&nbsp;

                    <INPUT id="btnsubmit" type="submit" value="Submit" onclick ="refresh()" name="Btnsubmit">
                    <input id = "gates" type = "hidden" name = "gates" value= <%=oldgatesvalue%>
                    </form>

                    <%'When submit is hit only then execute this stored procedure-Updatetablequotaparams
                     'this stored procedure has 2 input parameters - Open/Close gates value and staff id of the
                     ' person who updated the Open/Close value.

                    %>

                    <% if fsubmit <> "" then
                                gatesvalue = request.Form("radiogroup")
                                oldgatesvalue = request.Form("gates")
                                            if oldgatesvalue <> gatesvalue then

                                                set oCmd = server.CreateObject("ADODB.Command")
                                                oCmd.ActiveConnection = oConn
                                                oCmd.CommandType = 4
                                                oCmd.CommandText = "updatetablequotaparams"
                                                call oCmd.Parameters.Append(oCmd.CreateParameter("@gate svalue", 2, adparaminput))
                                                call oCmd.Parameters.Append(oCmd.CreateParameter("@staf fid", 3, adparaminput))
                                                oCmd.Parameters("@gatesvalue") = gatesvalue
                                                oCmd.Parameters("@staffid") = staffid
                                                oCmd.Execute%>
                                                <script language="vbscript">
                                                    msgbox ("Record Updated!")


                                                </script>
                                            <%else%>
                                                    <script language="vbscript">
                                                        msgbox ("It is already set to this value. Record Cannot Be Updated!")
                                                    </script>
                                            <%end if%>

                    <%end if %>

after the update i want the new radio button values to show up in the right button but it doesnt refresh until u refresh the page
 
Old October 5th, 2004, 01:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Try updating the record before you retrieve it. Put your update code at the top of the page before the results are retrieved. Or use vbscript you use to write the value to alter the selected value.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Radio buttons disappear JoeBob49 ASP.NET 2.0 Basics 2 November 27th, 2006 09:57 AM
2 buttons going to same ASP page chrscote Classic ASP Basics 1 June 1st, 2005 03:00 PM
How to use the radio buttons? ben_VB VB.NET 2002/2003 Basics 1 January 18th, 2005 12:29 PM
Radio buttons over email??? morpheus Classic ASP Basics 5 April 20th, 2004 01:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.