?
Solved

form post not working in asp

Posted on 2013-06-04
11
Medium Priority
?
402 Views
Last Modified: 2013-06-06
I have a simple form that I am sending as a post.
Then on the thank you page, I am trying to get the data using request.form("")
I am not seeing the results.
when I change it to GET, i see the variables in the url bar.

is there something wrong with my form that it's not working?
<form action="thankyouInd.asp" method="post" name="form1" id="form1" >
     <fieldset>

       <h2> Please select an event </h2>
           <input type="radio" name="event" value="878739" id="event_0" />
           Mens Torah Mates Retreat              
          - July 3-7<br />

           <input type="radio" name="event" value="878740" id="event_1" />
           Womens Torah Mates Retreat - August 16-19<br />       
    
 <br />

    <label for="LastName" class="short">Last Name:</label>
    <input name="LastName" type="text" class="inputgeneric" id="LastName" maxlength="30" />
    <br />
    <div class="clear"></div>    <label for="father" class="short">First name:</label>
    <input name="firstname" type="text" class="inputgeneric" id="father" maxlength="30" />
     <br /><div class="clear"></div>
    <label for="spousename" class="short">Spouse&rsquo;s first name :</label>
    <input name="spousename" type="text" class="inputgeneric" id="spousename"  maxlength="30"/>
   <br /><div class="clear"></div>
    <label for="Address" class="short">Address:</label>
    <input name="Address" type="text" class="inputgeneric" id="Address" maxlength="50" />
    <br /><div class="clear"></div>
    
    <label for="city" class="short">City: </label>
    <input name="city" type="text" class="inputgeneric" id="city" maxlength="40" /> 
    <br /><div class="clear"></div>

    <label for="state" class="short">State: </label>
    <input name="state" type="text" class="inputgeneric" id="state" maxlength="20" /> 
    <br /><div class="clear"></div>
    <label for="zip" class="short">Zip:</label>
    <input name="zip" type="text" class="inputgeneric" id="zip" maxlength="15" />
     <br /><div class="clear"></div>
    
    <label for="homephone" class="short"> Home Phone :</label>
    <input name="homephone" type="text" class="inputgeneric" id="homephone" maxlength="50" />
                              <br /><div class="clear"></div>
    
    <label for="cellhusband" class="short"> Cell :</label>
   <input name="cellwife" type="hidden" class="inputgeneric" id="cellwife" maxlength="50" /> <input name="cellhusband" type="text" class="inputgeneric" id="cellhusband" maxlength="50" />    <input name="workphone" type="hidden" class="inputgeneric" id="workphone" maxlength="50" />
   
    <br /><div class="clear"></div>
   
    <label for="email" class="short"> Email: </label>
    <input name="email" type="text" class="inputgeneric" id="email" maxlength="50" />
   </fieldset>
     <fieldset>
       <div class="clear"></div>
    <p>Anything else you want to tell us?: 
    </p>
    <label for="otherRequests" class="short">&nbsp; </label>
    <span id="request">
    <textarea name="otherRequests" cols="45" rows="5" class="input" id="otherRequests"></textarea>
  </span>
       </fieldset><br />
<br />
  <label for="button">&nbsp;</label>
    <input name="button" type="button" id="button" onclick="verify();" value="Submit My Application"  class="inputgeneric"/></p>
  <p>&nbsp;  </p>
  <input type="hidden" name="MM_insert"  id="MM_insert" value="form1" />
 </form>

Open in new window

I've tried
 for each f in request.form()
 	response.write("<p>" & f & " = " & request.form(f) &"</p>")
 next

Open in new window

0
Comment
Question by:rivkamak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39221007
request.querystring is for get
request.form is for post
request is for either

Did you try
 for each f in request.form
 	response.write("<p>" & f & " = " & request.form(f) &"</p>")
 next

Open in new window

Is the above on the thank you page?
0
 

Author Comment

by:rivkamak
ID: 39221010
yes. I tried that code on the thank you page.
Nothing showing up
I tried a regular (response.write()) and it worked.
so the page is loading asp
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 total points
ID: 39221087
I didn't have your 'verify()' javascript so I just put a regular submit button in there.  I also had it post to my generic PHP-GET-POST page to check and then to a page with your ASP code and it worked fine.  I'm not sure your submit method is working.  This is my working version.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Untitled</title>
</head>
<body>
<form action="thankyouInd.asp" method="post" name="form1" id="form1" >
<!-- <form action="PHP-GET-POST.php" method="post" name="form1" id="form1" > -->
     <fieldset>

       <h2> Please select an event </h2>
           <input type="radio" name="event" value="878739" id="event_0" />
           Mens Torah Mates Retreat              
          - July 3-7<br />

           <input type="radio" name="event" value="878740" id="event_1" />
           Womens Torah Mates Retreat - August 16-19<br />       
    
 <br />

    <label for="LastName" class="short">Last Name:</label>
    <input name="LastName" type="text" class="inputgeneric" id="LastName" maxlength="30" />
    <br />
    <div class="clear"></div>    <label for="father" class="short">First name:</label>
    <input name="firstname" type="text" class="inputgeneric" id="father" maxlength="30" />
     <br /><div class="clear"></div>
    <label for="spousename" class="short">Spouse&rsquo;s first name :</label>
    <input name="spousename" type="text" class="inputgeneric" id="spousename"  maxlength="30"/>
   <br /><div class="clear"></div>
    <label for="Address" class="short">Address:</label>
    <input name="Address" type="text" class="inputgeneric" id="Address" maxlength="50" />
    <br /><div class="clear"></div>
    
    <label for="city" class="short">City: </label>
    <input name="city" type="text" class="inputgeneric" id="city" maxlength="40" /> 
    <br /><div class="clear"></div>

    <label for="state" class="short">State: </label>
    <input name="state" type="text" class="inputgeneric" id="state" maxlength="20" /> 
    <br /><div class="clear"></div>
    <label for="zip" class="short">Zip:</label>
    <input name="zip" type="text" class="inputgeneric" id="zip" maxlength="15" />
     <br /><div class="clear"></div>
    
    <label for="homephone" class="short"> Home Phone :</label>
    <input name="homephone" type="text" class="inputgeneric" id="homephone" maxlength="50" />
                              <br /><div class="clear"></div>
    
    <label for="cellhusband" class="short"> Cell :</label>
   <input name="cellwife" type="hidden" class="inputgeneric" id="cellwife" maxlength="50" /> <input name="cellhusband" type="text" class="inputgeneric" id="cellhusband" maxlength="50" />    <input name="workphone" type="hidden" class="inputgeneric" id="workphone" maxlength="50" />
   
    <br /><div class="clear"></div>
   
    <label for="email" class="short"> Email: </label>
    <input name="email" type="text" class="inputgeneric" id="email" maxlength="50" />
   </fieldset>
     <fieldset>
       <div class="clear"></div>
    <p>Anything else you want to tell us?: 
    </p>
    <label for="otherRequests" class="short">&nbsp; </label>
    <span id="request">
    <textarea name="otherRequests" cols="45" rows="5" class="input" id="otherRequests"></textarea>
  </span>
       </fieldset><br />
<br />
  <label for="button">&nbsp;</label>
    <!-- <input name="button" type="button" id="button" onclick="verify();" value="Submit My Application"  class="inputgeneric"/></p> -->
    <input type="submit" name="button" id="button" value="Submit My Application"  class="inputgeneric"/></p>
  <p>&nbsp;  </p>
  <input type="hidden" name="MM_insert"  id="MM_insert" value="form1" />
 </form>
</body>
</html>

Open in new window

0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:rivkamak
ID: 39222375
its something extremely strange. i put the code here:
http://www.oorah.org/shabbatwithoorah/index-individual2.html

the thank you page is blank except for this
      
<%
 for each f in request.form()
       response.write("<p>" & f & " = " & request.form(f) &"</p>")
 next
%>

and i am still getting nothing in return
0
 

Author Comment

by:rivkamak
ID: 39222820
Is it possible method="post" is case sensitive?
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39223201
You have

<form action="thankyouInd.asp" method="post" name="form1" id="form1" >
<!-- <form action="PHP-GET-POST.php" method="post" name="form1" id="form1" > -->
   
just to be safe, remove the 2nd line.

Then make sure the action is going to
http://www.oorah.org/shabbatwithoorah/index-individual2.html

However, it needs to go to a .asp page and not .html page.    Unless you tell iss to interpret html as asp, I dont' think that will work.  So the page should be http://www.oorah.org/shabbatwithoorah/index-individual2.asp
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39223210
No, method="post" is Not case sensitive.  I can see by looking at the HTTP headers that the info is being posted.  If you put your ASP code above in the middle of the page, you should be able to see what is being posted.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39223251
@Padas, you're posting my version.  PHP-GET-POST.php is my test page for showing everything that is submitted.  The code he posted works.  There's just something about how he is using it.
0
 
LVL 82

Expert Comment

by:hielo
ID: 39225791
>> for each f in request.form()
get rid of the parentheses and try again.

<%
 for each f in Request.Form
       response.write("<p>" & f & " = " & request.form(f) &"</p>")
 next
%>

Open in new window

0
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 1000 total points
ID: 39226016
Sorry @DaveBaldwin.  Your right, something is missing here.
0
 

Author Closing Comment

by:rivkamak
ID: 39226527
Thank you for your help
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question