473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Changing submit function according to what user selects in pulldown list

I have made a form at http://www.lcuk.org/cleanair/form.htm

In the Financial Information section there is a question "How do you
wish to pay?"

If the user selects "invoice" then when the user hits submit I want
the form simply to call a formmail.cgi script and email the contents
to me.

However if the user selects "credit card" then I need to pass the form
contents to a second form (http://www.lcuk.org/cleanair/form2.htm) to
be held on a secure server so that the user's credit card details can
be given. The details from the first form need to be written to the
corresponding boxes on the second form.

Is there a way to do all this?

I'm new to all this and would really appreciate some help! Please
assume I'm stupid and know nothing...
Jul 20 '05 #1
2 1469
Claire Osborne wrote:
I have made a form at http://www.lcuk.org/cleanair/form.htm

In the Financial Information section there is a question "How do you
wish to pay?"

If the user selects "invoice" then when the user hits submit I want
the form simply to call a formmail.cgi script and email the contents
to me.

However if the user selects "credit card" then I need to pass the form
contents to a second form (http://www.lcuk.org/cleanair/form2.htm) to
be held on a secure server so that the user's credit card details can
be given. The details from the first form need to be written to the
corresponding boxes on the second form.

Is there a way to do all this?

I'm new to all this and would really appreciate some help! Please
assume I'm stupid and know nothing...


Most reliable way? Submit the form to someScript.cgi and have
someScript.cgi check the payment method and redirect accordingly.

Javascript way? onSubmit, call a function that will set the forms action
property and then submit the form. Doesn't work with js disabled.

Alternative:
Use both. Set the action of the form to the someScript.cgi, and onSubmit
have JS check the payment method, and reset the forms action. Then, if
JS is disabled, the server handles it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2
In article <12**************************@posting.google.com >,
cl****@interface-web.co.uk enlightened us with...
I have made a form at http://www.lcuk.org/cleanair/form.htm


This is an internet application. Do not rely on javascript for internet
applications. You're asking for problems if you do. Not everyone has JS
enabled. What would happen to those people?

IOW, use server-side code to do this for internet applications. Have the
form submit to a page that checks which option to do, then that page
does the appropriate thing.
Most (if not all) server-side scripting languages have the ability to
forward. Edit your formmail script to forward to the other html page if
appropriate.
Check a perl group for details.
--
--
~kaeli~
The definition of a will?... (It's a dead giveaway.)
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
Hello, I'm looking for an example of doing a page with pulldown menus, where the user selects a choice from the first pulldown, then based on that input, another appears, then the user selects...
3
by: jeff | last post by:
Hello, I have a form that submits it's values to a pop-up window. I've simplied the code: <form name="formname" action="action.php" target="windowName" method="post" onsubmit="window.open('',...
1
by: Deidre | last post by:
I am having a weird problem. I have an application thats default.aspx page is a menu page when a menu item is selected the requested page is loaded into default.aspx using iframes. When unsaved...
2
by: ColinWard | last post by:
Hi. I have a form which has as its recordsource an SQL string. The SQL String is as follows: SELECT * from CONTACTS where false. this ensures that there is no data loaded in the form when the...
3
by: qwerty | last post by:
I´m new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a...
15
by: Sonnich | last post by:
Hi all! I have a file where I'd have to submit buttons, and I need to differ between those. Step #1 - open html win with default selection Step #2 - user may select some criteries for the...
4
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters...
13
Frinavale
by: Frinavale | last post by:
I've been trying all morning to cancel a form submit to the server. I have a JavaScript Object that determines whether or not the page should be submitted to the server depending on whether the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.