Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Passing Form Data


Message #1 by "Chris Atherton" <webmaster@c...> on Fri, 3 Jan 2003 16:34:15 -0600
Can someone please help, or point me in the right direction to learn....

I'm trying to upgrade a workorder application. I'd like to be able to input data to a single form field (workorder ID) then display
the workorder data on the following page. Below that display, I would like to have form fields with identical fields of the display
pre-populated with the same info as the display (current database info). The information contained in the pre-populated forms could
then be edited as needed. The user would then submit these/any changes via the submit button with the updated information being
displayed on a following page.

I'm sure this isn't a hard task, but I'm currently not proficient enough to see the whole code. Hopefully I explained this without
confusion.

Any help would be greatly appreciated.

Thanks in advanced ! 
Chris Atherton
Harrison County
Computer Operations
Message #2 by Greg Griffiths <greg2@s...> on Sat, 04 Jan 2003 18:24:54 +0000
just run a query to return the data and then populate those values into the 
VALUE attribute of each HTML element :

<input type="text" name="projName" size="100" value="<%= projname %>">

At 16:34 03/01/03 -0600, you wrote:
>Can someone please help, or point me in the right direction to learn....
>
>I'm trying to upgrade a workorder application. I'd like to be able to 
>input data to a single form field (workorder ID) then display the 
>workorder data on the following page. Below that display, I would like to 
>have form fields with identical fields of the display pre-populated with 
>the same info as the display (current database info). The information 
>contained in the pre-populated forms could then be edited as needed. The 
>user would then submit these/any changes via the submit button with the 
>updated information being displayed on a following page.
>
>I'm sure this isn't a hard task, but I'm currently not proficient enough 
>to see the whole code. Hopefully I explained this without confusion.
>
>Any help would be greatly appreciated.
>
>Thanks in advanced !
>Chris Atherton
>Harrison County
>Computer Operations
>



Message #3 by "Harco Webmaster" <webmaster@c...> on Sat, 4 Jan 2003 21:21:50 -0600
Thanks for your reply.
Here's the query I'm using. Most of it taken right from Beginning ASP 3.0.

'Dim objCommand, objRS, strTech
'strTech = Request("tech")

'Set objCommand = Server.CreateObject("ADODB.Command")

'objCommand.ActiveConnection = strConnect
'objCommand.CommandText = "SELECT * FROM tbl_workorder 'WHERE tech = '" &
strTech & "' " & _
                           '"AND completed = 'yes'"

What is the correct code to use when querying information in this fashion,
and do I need declare these values?

It works when I add <%= strTech %> to the form field, but I have no luck
pulling undeclared values.

Message #4 by Mark Eckeard <meckeard2000@y...> on Sat, 4 Jan 2003 19:26:44 -0800 (PST)
Try this:

"SELECT * FROM 
tbl_workorder 
WHERE tech = '" & strTech & "' AND completed = 'yes'" 


--- Harco Webmaster <webmaster@c...>
wrote:
> Thanks for your reply.
> Here's the query I'm using. Most of it taken right
> from Beginning ASP 3.0.
> 
> 'Dim objCommand, objRS, strTech
> 'strTech = Request("tech")
> 
> 'Set objCommand 
> Server.CreateObject("ADODB.Command")
> 
> 'objCommand.ActiveConnection = strConnect
> 'objCommand.CommandText = "SELECT * FROM
> tbl_workorder 'WHERE tech = '" &
> strTech & "' " & _
>                            '"AND completed = 'yes'"
> 
> What is the correct code to use when querying
> information in this fashion,
> and do I need declare these values?
> 
> It works when I add <%= strTech %> to the form
> field, but I have no luck
> pulling undeclared values.
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Message #5 by "Harco Webmaster" <webmaster@c...> on Sat, 4 Jan 2003 21:34:50 -0600
Thanks Mark. My query pulls and displays the information perfectly. Outlook
screwed my code up.

However, I want to populate an additional set of form fields for editing
with the queried information.

If I use :
'<input type="text" name="tech" value="<%= objRS("strTech") %>">
it correctly inserts the tech in the form field. My problem is how do I get
the other queried info into the remaining the remaining forms fields since I
don't have them declared anywhere?

----- Original Message -----
From: "Mark Eckeard" <meckeard2000@y...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Saturday, January 04, 2003 9:26 PM
Subject: [asp_web_howto] Re: Passing Form Data


>
> Try this:
>
> "SELECT * FROM
> tbl_workorder
> WHERE tech = '" & strTech & "' AND completed = 'yes'"
>
>
> --- Harco Webmaster <webmaster@c...>
> wrote:
> > Thanks for your reply.
> > Here's the query I'm using. Most of it taken right
> > from Beginning ASP 3.0.
> >
> > 'Dim objCommand, objRS, strTech
> > 'strTech = Request("tech")
> >
> > 'Set objCommand 
> > Server.CreateObject("ADODB.Command")
> >
> > 'objCommand.ActiveConnection = strConnect
> > 'objCommand.CommandText = "SELECT * FROM
> > tbl_workorder 'WHERE tech = '" &
> > strTech & "' " & _
> >                            '"AND completed = 'yes'"
> >
> > What is the correct code to use when querying
> > information in this fashion,
> > and do I need declare these values?
> >
> > It works when I add <%= strTech %> to the form
> > field, but I have no luck
> > pulling undeclared values.
> >
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>

Message #6 by "Harco Webmaster" <webmaster@c...> on Sat, 4 Jan 2003 21:40:44 -0600
Sorry. The form field displays the correct tech after the query when I use :
<input type="text" name="tech" value="<%= strTech  %>">

My mistake. The strTech is declared at and the other fields I want are not.
How do I get the other information in 4 other additonal fields below the one
I listed above ?

----- Original Message -----
From: "Mark Eckeard" <meckeard2000@y...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Saturday, January 04, 2003 9:26 PM
Subject: [asp_web_howto] Re: Passing Form Data


>
> Try this:
>
> "SELECT * FROM
> tbl_workorder
> WHERE tech = '" & strTech & "' AND completed = 'yes'"
>
>
> --- Harco Webmaster <webmaster@c...>
> wrote:
> > Thanks for your reply.
> > Here's the query I'm using. Most of it taken right
> > from Beginning ASP 3.0.
> >
> > 'Dim objCommand, objRS, strTech
> > 'strTech = Request("tech")
> >
> > 'Set objCommand 
> > Server.CreateObject("ADODB.Command")
> >
> > 'objCommand.ActiveConnection = strConnect
> > 'objCommand.CommandText = "SELECT * FROM
> > tbl_workorder 'WHERE tech = '" &
> > strTech & "' " & _
> >                            '"AND completed = 'yes'"
> >
> > What is the correct code to use when querying
> > information in this fashion,
> > and do I need declare these values?
> >
> > It works when I add <%= strTech %> to the form
> > field, but I have no luck
> > pulling undeclared values.
> >
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>

Message #7 by Mark Eckeard <meckeard2000@y...> on Sat, 4 Jan 2003 20:40:15 -0800 (PST)
I missed the beginning of this thread.

Can you please repost it so I can truly understand
what it is you are trying to achieve?

And feel free to email off-list to avoid any repeat
email.

Mark
--- Harco Webmaster <webmaster@c...>
wrote:
> Sorry. The form field displays the correct tech
> after the query when I use :
> <input type="text" name="tech" value="<%= strTech 
> %>">
> 
> My mistake. The strTech is declared at and the other
> fields I want are not.
> How do I get the other information in 4 other
> additonal fields below the one
> I listed above ?
> 
> ----- Original Message -----
> From: "Mark Eckeard" <meckeard2000@y...>
> To: "ASP Web HowTo" <asp_web_howto@p...>
> Sent: Saturday, January 04, 2003 9:26 PM
> Subject: [asp_web_howto] Re: Passing Form Data
> 
> 
> >
> > Try this:
> >
> > "SELECT * FROM
> > tbl_workorder
> > WHERE tech = '" & strTech & "' AND completed 
> 'yes'"
> >
> >
> > --- Harco Webmaster <webmaster@c...>
> > wrote:
> > > Thanks for your reply.
> > > Here's the query I'm using. Most of it taken
> right
> > > from Beginning ASP 3.0.
> > >
> > > 'Dim objCommand, objRS, strTech
> > > 'strTech = Request("tech")
> > >
> > > 'Set objCommand 
> > > Server.CreateObject("ADODB.Command")
> > >
> > > 'objCommand.ActiveConnection = strConnect
> > > 'objCommand.CommandText = "SELECT * FROM
> > > tbl_workorder 'WHERE tech = '" &
> > > strTech & "' " & _
> > >                            '"AND completed 
> 'yes'"
> > >
> > > What is the correct code to use when querying
> > > information in this fashion,
> > > and do I need declare these values?
> > >
> > > It works when I add <%= strTech %> to the form
> > > field, but I have no luck
> > > pulling undeclared values.
> > >
> > >
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > http://mailplus.yahoo.com
> >
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Message #8 by "Harco Webmaster" <webmaster@c...> on Sat, 4 Jan 2003 23:09:09 -0600
Sure Mark.

I have a section of an Intranet application that displays workorder
information. Currently, you enter a workorder by ID number via a form. The
following page displays the workorder information via an SQL query. On the
same page, below the displayed information, I have a form. (note: my query
works and displays fine) This form then submits to a 3rd page which updates
the database. However, since the form fields are blank, if I don't enter ALL
the information it updates the database with blank information.

I want to be able to pre-populate the form fields with information from the
table so I only have to change information and not completely re-enter. I'm
not sure how to add the information to the fields from the queried data.
Using the query you saw earlier, I can populate only one field of the form.
'<input type="text" name="tech" value="<%= strTech %>">

Since strTech is declared, it works fine. How do I insert data into the
other fields without declared statements? If I'm going to declare them, how
exactly do I declare them?

The other fields I want to populate are:
completed, remarks, problem, hardware, software

I appreciate the help!

----- Original Message -----
From: "Mark Eckeard" <meckeard2000@y...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Saturday, January 04, 2003 10:40 PM
Subject: [asp_web_howto] Re: Passing Form Data


> I missed the beginning of this thread.
>
> Can you please repost it so I can truly understand
> what it is you are trying to achieve?
>
> And feel free to email off-list to avoid any repeat
> email.
>
> Mark
> --- Harco Webmaster <webmaster@c...>
> wrote:
> > Sorry. The form field displays the correct tech
> > after the query when I use :
> > <input type="text" name="tech" value="<%= strTech
> > %>">
> >
> > My mistake. The strTech is declared at and the other
> > fields I want are not.
> > How do I get the other information in 4 other
> > additonal fields below the one
> > I listed above ?
> >
> > ----- Original Message -----
> > From: "Mark Eckeard" <meckeard2000@y...>
> > To: "ASP Web HowTo" <asp_web_howto@p...>
> > Sent: Saturday, January 04, 2003 9:26 PM
> > Subject: [asp_web_howto] Re: Passing Form Data
> >
> >
> > >
> > > Try this:
> > >
> > > "SELECT * FROM
> > > tbl_workorder
> > > WHERE tech = '" & strTech & "' AND completed 
> > 'yes'"
> > >
> > >
> > > --- Harco Webmaster <webmaster@c...>
> > > wrote:
> > > > Thanks for your reply.
> > > > Here's the query I'm using. Most of it taken
> > right
> > > > from Beginning ASP 3.0.
> > > >
> > > > 'Dim objCommand, objRS, strTech
> > > > 'strTech = Request("tech")
> > > >
> > > > 'Set objCommand 
> > > > Server.CreateObject("ADODB.Command")
> > > >
> > > > 'objCommand.ActiveConnection = strConnect
> > > > 'objCommand.CommandText = "SELECT * FROM
> > > > tbl_workorder 'WHERE tech = '" &
> > > > strTech & "' " & _
> > > >                            '"AND completed 
> > 'yes'"
> > > >
> > > > What is the correct code to use when querying
> > > > information in this fashion,
> > > > and do I need declare these values?
> > > >
> > > > It works when I add <%= strTech %> to the form
> > > > field, but I have no luck
> > > > pulling undeclared values.
> > > >
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > > http://mailplus.yahoo.com
> > >
> >
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>

Message #9 by "Chris Atherton" <webmaster@c...> on Sun, 5 Jan 2003 11:36:15
Thanks Greg and Mark. I appreciate the help. I figured it out last night.

  Return to Index