473,398 Members | 2,403 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,398 software developers and data experts.

Changing Form Data

Hello:

I've done an exhaustive online search and either can't find what I'm looking
for or I'm unable to make what I've found work. I'm not a programmer, but
I'm sure that this is probably elementary stuff.

What I have is a form which is being POSTed to an ASP script which processes
the script and emails it to a specified recipient (which is set in a hidden
form field).

In this form, I have a popup menu of a list of items. Based on which menu
item is selected, I would like the recipient value to change accordingly.
The "value" of the menu item cannot be used as it is capturing other data.

For example:

<select name="country">
<option value="12345">USA</option> -- email to us***@xyz.com
<option value="45678">France</option> -- email to us***@xyz.com
<option value="98765">Spain</option> -- email to us***@xyz.com
</select>

As I said, there is a hidden field:

<input type="hidden" name="email" value="su*****@xyz.com">

So if someone selects "France", the email "su*****@xyz.com" changes to
"us***@xyz.com" and then the form is sent to the ASP script for processing.

If anyone has any insight or can point me to a site w/code which can help,
it would be greatly appreciated.

George

Jul 20 '05 #1
1 7330


George Rogic wrote:
Hello:

I've done an exhaustive online search and either can't find what I'm looking
for or I'm unable to make what I've found work. I'm not a programmer, but
I'm sure that this is probably elementary stuff.

What I have is a form which is being POSTed to an ASP script which processes
the script and emails it to a specified recipient (which is set in a hidden
form field).

In this form, I have a popup menu of a list of items. Based on which menu
item is selected, I would like the recipient value to change accordingly.
The "value" of the menu item cannot be used as it is capturing other data.

For example:

<select name="country">
<option value="12345">USA</option> -- email to us***@xyz.com
<option value="45678">France</option> -- email to us***@xyz.com
<option value="98765">Spain</option> -- email to us***@xyz.com
</select>

As I said, there is a hidden field:

<input type="hidden" name="email" value="su*****@xyz.com">

So if someone selects "France", the email "su*****@xyz.com" changes to
"us***@xyz.com" and then the form is sent to the ASP script for processing.

If anyone has any insight or can point me to a site w/code which can help,
it would be greatly appreciated.


If you use ASP on the server you should change the ASP page to examine
the posted data and then change the email as needed.
With client side JavaScript your form will only function correctly if
the user has a browser with JavaScript support enabled.
If you can't change the ASP page then you could use an onchange handler
<select
onchange="switch (this.selectedIndex) {
case 0:
this.form.email.value = 'w*******@whereever.tld';
break;
case 1:
this.form.email.value = 'w******@whereever.tld';
break;
...
}"
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

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('',...
7
by: Stefan Finzel | last post by:
Hi, is there a way to change the display property on Windows Mobile 2003 SE Mobile/Pocket Internet Explorer? See following example. Please note: visibilty property has the same problem. Is...
3
by: Jeff | last post by:
Hi I have a report with a graph on it and want to change the minimum and maximum values for the value axis when it is previewed. This can't be done by adding code in the Open event as once the...
10
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
2
by: S P Arif Sahari Wibowo | last post by:
Hi! Do you know how to put a form's Access-Visual-Basic-code that will force the form to be inserted, while the user has not type anything in the form, without changing focus, selection, etc.? ...
4
by: Tony W | last post by:
Hi, I am trying to write a simple application to retrieve data from the Windows registry and insert it into textboxs on a windows form. So far I have one namespace containing two classess. ...
5
by: Mark Fox | last post by:
Hello, When you add a new web form in VS.NET it automatically adds the following namespaces at the top: using System; using System.Collections; using System.ComponentModel; using...
32
by: deko | last post by:
I have a popup form with a textbox that is bound to a memo field. I've been warned about memo fields so I'm wondering if I should use this code. Is there any risk with changing the form's...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
5
by: marton | last post by:
Hi there, I'm new to posting on the forum, and I've been working with MS Access for a couple of years, but and other than that know nothing about programming. I have a fairly simple, networked,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.