Forums

ASP

This topic is locked

dynamic text fields problem

Posted 03 Aug 2005 18:47:03
1
has voted
03 Aug 2005 18:47:03 henry leung posted:
I am writing a web-base software using dreamweaver, asp, vbscript and javascript.
i had create a dynamic text fields and the number of the text fields are depend on one of the value that been passed part the page before, then there is a submit button which will pass all the text fields' data to the next asp page for storing in the database.

my question is, how can i store the data in the database dynamically?

i tried to use for loop but it didn't work.heard that i maybe able to do that with control collection of VB.
can anyone explain to me what control collection is and how to use it?


henry

Replies

Replied 04 Aug 2005 13:06:36
04 Aug 2005 13:06:36 henry leung replied:
well, i have solved my problem.

and now i have problem with the buttons within the form.
i have two buttons in the same form and when user click the button, it will pass the data to two different asp page.
here is my code:
--------------------------------------------
<Javascript>

function renew()
{
document.expired.action = "new_expiry.asp";
document.expired.submit ;
}

function remove()
{
document.expired.action = "remove.asp";
document.expired.submit ;
}
-----------------------------------------------------

<form name="expired" method="post" action="">
-----------------------------------------------------

<input type="button" name="renew" value="renew" onMouseOver="javascript:this.style.color='#3399CC';" onMouseOut="javascript:this.style.color='navy'" onClick="renew()">
<input type="button" name="remove" value="remove" onMouseOver="javascript:this.style.color='#3399CC';" onMouseOut="javascript:this.style.color='navy'" onClick="remove()">

it should work in logic but somehow just doesn't work and i can't see what the problem is.
please help if you can


henry

p.s. im on my student placement and i am a newbie of ASP and VBScript
Replied 05 Aug 2005 13:29:22
05 Aug 2005 13:29:22 henry leung replied:
i have solved the problem with that two buttons in the same form and because there is no same type of solution here, i decide to post the solution i had.

name both buttons with the same name as the following:
<form name="form1" method="post" action="redirect.asp">
.......
...........
<input type="text" name="expired" value="">
........
.....................
<input type="submit" name="hello" value="Renew">
<input type="submit" name="hello" value="Remove">
</form>

----------------------------------------------------------------------------------------------
redirect.asp:

choice = Request.Form("hello"


expired = request.Form("expired"

response.Cookies("expired" = expired

Select Case hello
Case "Renew"
response.Redirect("new_expiry.asp"
Case "Remove"
response.Redirect("remove.asp"
End Select

Reply to this topic