Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 30th, 2005, 03:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default loop values and text box values move

How can move values recieve by loop and input values to
next page ?


<form method=post action="http://localhost/tabulation/mhours/mhconfirmadd.asp?userid=<%= Response.Write(userid) %>" id=myform

name=myform onSubmit="return docheck()">




ssql="select projno from project"
set rs=cn.Execute(ssql)

%>

    <h1 align="center">&nbsp; </h1>
      <blockquote>
        <blockquote>
          <div align="left"></div>
        </BLOCKQUOTE>
      </BLOCKQUOTE>
     <P align=center>

      <table width="80%" border="1" bordercolor="#black" cellspacing="0" cellpadding="0">
        <%do while rs.eof=false%>
        <tr>
          <td colspan="3"><div align="left"><strong><%Response.Write(rs("projno") )%></strong></div></td>
          <td width="11%"> <div align="center">

            </div></td>

            <td width="11%"> <div align="center">
              <INPUT id=mh1 name=mh1 style="WIDTH: 83px; HEIGHT: 22px" size=10>
            </div></td>

            <td width="11%"> <div align="center">
              <INPUT id=mh2 name=mh2 style="WIDTH: 83px; HEIGHT: 22px" size=10>
            </div></td>

            <td width="11%"> <div align="center">
              <INPUT id=mh3 name=mh3 style="WIDTH: 83px; HEIGHT: 22px" size=10>
            </div></td>

            <td width="11%"> <div align="center">
              <INPUT id=mh4 name=mh4 style="WIDTH: 83px; HEIGHT: 22px" size=10>
            </div></td>



        </tr>

        <%
        rs.movenext
        loop
        %>

      </table>
      <br>
      <input type=submit value="Save" id=submit name="submit">
     </form>

-----------------------
next page asp file


userid=Request.QueryString("userid")

projno=Request.Form("projno")
mh1=Response.Write("mh1")
mh2=Response.Write("mh2")
mh3=Response.Write("mh3")
mh4=Response.Write("mh4")


Response.Write(userid)
Response.Write(projno)
Response.Write(mh1)
Response.Write(mh2)
Response.Write(mh3)
Response.Write(mh4)

------------------
ie.
project no value display by the loop
and againt of each projectno user enter
the MH1, MH2, MH3, MH4 values in input box


project no.....MH1......MH2....MH3....MH4
------------------------------------------
2016.........10......20......10......25
3210.........10......20......10......25
2002.........10......20......10......25
...
..

above values to move next page how ?

each projectno have separate values.
Please help to correct the code.

regards.

Mateen




Reply With Quote
  #2 (permalink)  
Old March 30th, 2005, 10:47 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Houston, TX, USA.
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, Mateen,
You should dynamically change the input file name like:
<%loopIndex = -1
  do while rs.eof=false
  loopIndex = loopIndex + 1
%>
<td width="11%"> <div align="center">
 <INPUT id=mh1<%=loopIndex %> name=mh1<%=loopIndex %> style="WIDTH: 83px; HEIGHT: 22px" size=10>
            </div></td>

            <td width="11%"> <div align="center">
              <INPUT id=mh2<%=loopIndex %> name=mh2<%=loopIndex %> style="WIDTH: 83px; HEIGHT: 22px" size=10>
            </div></td>

            <td width="11%"> <div align="center">
              <INPUT id=mh3<%=loopIndex %> name=mh3<%=loopIndex %> style="WIDTH: 83px; HEIGHT: 22px" size=10>
            </div></td>
 <%
        rs.movenext
        loop
  %>
 to make sure each <input> field has unique name.
 your projectNo cann't be passed to the next page. if you want it to be passed, you should put them in <input> tag

 In the next asp page:
 if the projectNo cann't be empty, you can loop the table rows like:

 <%for index = 0 to MAXAVAILABLENUMBER
     if request.form("projectNo" & index) <> "" then
        projno = request.form("projectNo" & index)
        mh1=request.form("mh1" & index )
        mh2=request.form("mh2" & index )
        mh3=request.form("mh3" & index )
        mh4=request.form("mh4" & index )
        'THEN DISPLAY THEM
     else
        exit for
     end if
 Next%>

 I didn't test it, but the idea is like this.

 Andraw




Reply With Quote
  #3 (permalink)  
Old April 5th, 2005, 11:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your response.

each projectno received separate values to next page ?

ie.

projno=2010
mh1=10
mh2=25
mh3=35
mh4=15

projno=2016
mh1=25
mh2=45
mh3=39
mh4=38
..
.

I am trying.

regards.

Mateen


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab Values From List Box into Text Box phungleon VB How-To 2 June 19th, 2008 10:33 PM
Text box values are different shoakat Classic ASP Databases 2 April 28th, 2005 12:29 AM
How to get values of a text box from one page to NitinJoshi General .NET 3 January 6th, 2005 06:30 AM
putting the values in the text box shoakat Classic ASP Databases 5 October 14th, 2004 02:37 PM
Getting text box values between forms? cdnamm BOOK: Professional C#, 2nd and 3rd Editions 1 August 13th, 2003 11:05 PM



All times are GMT -4. The time now is 12:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.