?
Solved

Front page form + additional asp code????

Posted on 2003-03-06
4
Medium Priority
?
218 Views
Last Modified: 2013-12-24
My Client has written his own frontpage form that posts to an Access database.
The page is asp.

He now wants me to add code to build a query string from the entry posted and forward to an email address.

All of which I can write, but cant figure out a way of adding a server side function to the form.

Any one got any ideas?
I have tried adding a clientside function call on the onsubmit, that updates a textbox,then have a server script checking the value of the textbox. But the frontpage webots seem to go mental and break the page.

Re-writing the page in real vb script would obviously fix the problem, but is not an option due to budget and time.

Thanks
Andy
0
Comment
Question by:andy_booth
[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 Comments
 
LVL 2

Accepted Solution

by:
memerot earned 400 total points
ID: 8272729
You need to re-architect unfortunately.  The code is very small.  The page NEEDS to post to itself first so that you can do the email.  Then it can send the info off to the first target.

So you have the form post to itself:

<form action="myPage.asp" method="post">
<input type="hidden" name="action" value="save">
...
</form>

And you have a server side handler that does the email, and THEN resends the info.  It resends the info by writing out a copy of the form and autosubmitting it with a snip of client side javascript:
<%
If Request.Form("action") = "save" Then
   'do your email stuff, CDO, yadda yadda
   'now you write out an html form pointed at the original target
   Dim var
   %>
      <form action="originalTarget.xxx" method="post" id="frmSecondStep">
       <% For Each var In Request.Form %>
          <input type="hidden" name="<%= var %>" value="<%= Request.Form(var) %>">
       <% Next %>
      </form>
      <script language="javascript">
         // Auto submit this form
         document.getElementById("frmSecondStep").submit()
      </script>
<%
End If
%>

0
 
LVL 1

Author Comment

by:andy_booth
ID: 11210258
Hi,

Sorry for the delay, I guess I decided to re-write this, I had forgotten all about it.
Awarded the points anyway.

Regards
Andy
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
Suggested Courses

752 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