ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 7th, 2003, 10:47 AM
Phlegthon Phlegthon is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 1 Phlegthon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Just Starting Out - need suggestions on what tools to use

Now, I'm only a beginner at ASP. I find myself having to make some order forms that would be fairly basic if it weren't for the fact that there are a lot of items, and consequently lots of variables to keep track of. I was wondering if there's some sort of utility that scans forms and compiles a list of variables in it into a text file, or even better that can take said list and preform certain actions with it, like putting them all in hidden fields, or into the variable_name = Request.form("variable_name") thing (don't know what that step's called, but apparently it's needed to take variables over from one asp file to another?). A program with features like these would save me plenty time.

Anyway if someone can help me here, I'd really appreciate it.

Reply With Quote
  #2  
Old May 7th, 2003, 06:58 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 9 m 52 sec
Reputation Power: 10
Send a message via ICQ to stumpy Send a message via MSN to stumpy
If you have a form with a lot a fields (any number actually), there's a few methods you can use to make your life very simple indeed. The one i use is:

Name all your fields the same as their name in the DB
Prefix the form fields with some kind of identifier. I use "txt_"

The ASP page that you then post to just has to do a request.form() - then loop thru all the form elements beginning with "txt_".

Build your SQL strings as you go, then just stick them onto an INSERT or UPDATE statement, along w/ the corresponding table information, and your done.

Note that above "tool" takes a bit of time and thinking to write, BUT, this one script can be used by EVERY SINGLE SITE you do from now on! It will save you HOURS of coding!
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old May 15th, 2003, 07:13 AM
smcortez smcortez is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 4 smcortez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
On the receiving end you can iterate the request form collection using for each like code below

<%for Each ElemName in Request.form%>
<input type="hidden" name="<%=ElemName%>" value="<%=request.form(ElemName)%>">
<%next%>


The code above will list all the request collection in a hidden field...

HTH...

HAppy programming...

Reply With Quote
  #4  
Old May 15th, 2003, 07:20 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 9 m 52 sec
Reputation Power: 10
Send a message via ICQ to stumpy Send a message via MSN to stumpy
smcortez, where would you use this?

If looks like it just recreates the form and makes all fields hidden.

Iterating thru the is a good method too. It's a good idea to name your form fields with an identifier (e.g. txt_foo) so that when iterating thru the form, it's easy to pick out the useful fields, so you don't collect things like button names and co-ords of submit clicks... and any other junk from the form.

Reply With Quote
  #5  
Old May 16th, 2003, 01:42 AM
smcortez smcortez is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 4 smcortez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
@stumpy,

<<<<
where would you use this
<<<<


this will come in handy when you have a confirmation page wherein the user will check first if all entries are correct...


Basically you need to put it in a form and on the press aof a button you will submit to be send to the db... As well as to edit the entries...

As you can see the original is being rewritten but it is being put in a hidden field... This will make your coding much more easier...


HAppy programming...

Reply With Quote
  #6  
Old May 16th, 2003, 02:11 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 9 m 52 sec
Reputation Power: 10
Send a message via ICQ to stumpy Send a message via MSN to stumpy
sounds interesting - i'll give it go!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Just Starting Out - need suggestions on what tools to use


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek