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

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 6th, 2009, 11:57 PM
amahara amahara is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 amahara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 37 sec
Reputation Power: 0
[Classic ASP] about request.form

can i specify which request form that i want to process...

maybe like this :
if Not IsEmpty(Request.Form("test2")) then
...
end if

sorry for the bad english

here's my code :
Code:
<%
	if Not IsEmpty(Request.Form) then
		response.write(request.form("text1"))
		response.write("<br> + <br>")
                response.write(request.form("text2"))
	end if
%>

<body>
  <table id="table1">
    <tr>
      <td>
        <form id="test1" action="" method="post">
          <input id="text1" name="text1" type="Text">
          <input id="button1" type="button" value="button" onclick="javascript:document.getElementById('test1').submit  ();">
        </form>
      </td>
    </tr>
  </table>
  <br>
  <hr>
  <br> 
  <table id="table2">
    <tr>
      <td>
        <form id="test2" action="" method="post">
          <input id="text2" name="text2" type="text">
          <input id="button2" type="button" value="button" onclick="javascript:document.getElementById('test2').submit  ();">
        </form>
      </td>
    </tr>
  </table>
</body>

Reply With Quote
  #2  
Old July 7th, 2009, 04:09 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
--> Moved to ASP Forum

You can check to see if the Request.Form collection contains values and then test the length of each value, eg:
Code:
<%
Dim whichValue
If Request.Form.Count > 0 Then
    If Len(Trim(Request.Form("text1"))) > 0 Then
           whichValue = Request.Form("text1")
    Else
           whichValue = Request.Form("text2")
    End If
End If
%>

What exactly do you need to do?

Reply With Quote
  #3  
Old July 7th, 2009, 04:18 AM
amahara amahara is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 amahara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 37 sec
Reputation Power: 0
i want to give specific process for each form submitted

something like this


if (form1 submitted) then
do process x
end if


if (form2 submitted) then
do process y
end if



the problem is when i use
if(request.form) <-- i want this to respond to specific form only

Reply With Quote
  #4  
Old July 7th, 2009, 04:27 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
You could use submit buttons to submit teh forms and then test the value of the submit button, eg:
Code:
<html>
<%
If Request.Form("btnsubmit") = "Submit Form 1" Then
	'Form 1 submitted
Else
	'Form 2 Submitted
End IF
%>
<body>
  <table id="table1">
    <tr>
      <td>
        <form name="test1" id="test1" action="test2.asp" method="post">
          	<input id="text1" name="text1" type="Text">
          	<input type="submit" value="Submit Form 1" name="btnSubmit">
        </form>
      </td>
    </tr>
  </table>
  <br>
  <hr>
  <br>
  <table id="table2">
    <tr>
      <td>
        <form name="test2" id="test2" action="test2.asp" method="post">
          	<input id="text2" name="text2" type="text">
         	<input type="submit" value="Submit Form 2" name="btnSubmit">
        </form>
      </td>
    </tr>
  </table>
</body>

Reply With Quote
  #5  
Old July 7th, 2009, 04:33 AM
amahara amahara is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 amahara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 37 sec
Reputation Power: 0
aaah~

your right, thats what i needed,
however, can i used hyperlink instead of button to do that?


btw thx sync_or_swim

Reply With Quote
  #6  
Old July 7th, 2009, 04:42 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
Quote:
Originally Posted by amahara
aaah~

your right, thats what i needed,
however, can i used hyperlink instead of button to do that?


btw thx sync_or_swim

You're welcome, glad it helped!! With regards using a hyperlink, I dont think that is possible but one option would be to style your buttons to look like links:
Code:
<html>
<style type="text/css">
  .button-link
  {
  	cursor: hand;
    border: none;
    background-color: transparent;
    text-decoration: underline;
    padding: 0;
  }

  .link
  {
    color: blue;
    font-size: 1em;
    font-weight: normal;
    font-family: Arial;
  }
</style>


<%
If Request.Form("btnsubmit") = "Submit Form 1" Then
	'Form 1 submitted
Else
	'Form 2 Submitted
End IF
%>
<body>
  <table id="table1">
    <tr>
      <td>
        <form name="test1" id="test1" action="test2.asp" method="post">
          	<input id="text1" name="text1" type="Text">
          	<input type="submit" value="Submit Form 1" name="btnSubmit" class="button-link link">
        </form>
      </td>
    </tr>
  </table>
  <br>
  <hr>
  <br>
  <table id="table2">
    <tr>
      <td>
        <form name="test2" id="test2" action="test2.asp" method="post">
          	<input id="text2" name="text2" type="text">
         	<input type="submit" value="Submit Form 2" name="btnSubmit" class="button-link link">
        </form>
      </td>
    </tr>
  </table>
</body>

Reply With Quote
  #7  
Old July 7th, 2009, 05:02 AM
amahara amahara is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 amahara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 37 sec
Reputation Power: 0
lol, and here i am thinking that making it into hyperlink would
make it simpler

i guess i'll stick to the button then

thx again sync_or_swim

Reply With Quote
  #8  
Old July 7th, 2009, 05:13 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,461 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Day 16 h 50 m 26 sec
Reputation Power: 1806
Quote:
Originally Posted by amahara
lol, and here i am thinking that making it into hyperlink would
make it simpler

i guess i'll stick to the button then

thx again sync_or_swim

You're welcome, glad it helped!!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > [Classic ASP] about request.form


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.

 
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.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
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.

 
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.

 

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





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