473,799 Members | 3,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Results to display in order when submitting to an email

24 New Member
Hi
I have created a form and need a bit of help with my javascript? My for is created using HTML and its using media surface. The form is set up to submit to an email. the problem is I have a drop down for GBP or percentage and then a box to type in the amount. When the results display in the email the are showing on a seperate line but I want this to appear together like GBP 5.00 or Percentage 9

Here is what ive got:

Form field

[HTML]<TR>

<TD class="tableBac kLgtBlue2">EMPL OYER CONTRIBUTION</td>
<td class="tableBac kLgtBlue2"><sel ect size="1" name="sel13A_Ty pe">
<option value="">Select </option>
<option value="GBP">GBP </option>
<option value="Percent" >Percent</option>
</select>

<input type="text" name="txt13_Emp loyer_Contribut ion">

</td>

</tr>

<TR>





<TD class="tableBac kLgtBlue2">EMPL OYEE CONTRIBUTION</td>
<td class="tableBac kLgtBlue2"><sel ect size="1" name="sel14A_Ty pe">
<option value="">Select </option>
<option value="GBP">GBP </option>
<option value="Percent" >Percent</option>
</select>

<input type="text" name="txt14_Emp loyee_Contribut ion">


</td>



</tr>
[/HTML]

This is the javascript Ive tried to create so the results will appear on the same line but its not working.


Expand|Select|Wrap|Line Numbers
  1. var x=document.getElementById("sel13A_Type");
  2.    alert(x.selectedIndex);
  3.  
  4.    //Add GBP to Employer Contribution
  5. if(x.selectedIndex==1){
  6. f.txt13_Employer_Contribution.value= "GBP" + f.txt13_Employer_Contribution.value;
  7.  
  8. }
  9. else if(x.selectedIndex==2){
  10. f.txt13_Employer_Contribution.value= "Percent" + f.txt13_Employer_Contribution.value;  
  11. }
  12. else
  13. {
  14. alert("You must select Percent or GBP");
  15. return false;
  16. }
  17.  
  18.    f.txt14_Employee_Contribution.value= oForm.sel14A_Type.value + f.txt14_Employee_Contribution.value;  
  19.  
  20.    processForm(f);
  21.    return true;    
  22. }
  23.  
  24.  
  25.  
  26. function processForm(oForm)
  27. {
  28.  
  29.  
  30.  
  31.     oForm.txt13_Employee_Contribution.value = oForm.sel13A_Type.value + oForm.txt13_Employee_Contribution.value;
  32.     oForm.txt14_Employee_Contribution.value = oForm.sel14A_Type.value + oForm.txt14_Employee_Contribution.value;
  33.  
  34.  
  35. }


Any ideas???
Sep 19 '07 #1
4 1274
acoder
16,027 Recognized Expert Moderator MVP
Please use code tags when posting code, e.g.

[CODE=javascrip t]
Javascript code goes here
[/code]

When sending to email using the form action attribute, you are at the mercy of the browser and depending on the user's email software. The proper way would be to use a server-side script.
Sep 19 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Added more information to the thread title.
Sep 19 '07 #3
AR123
24 New Member
Anyone any ideas on this problem?
Sep 20 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
You could try removing the select elements once you've updated the text box.
Sep 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

11
4012
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
1
4196
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens in IE as well as FireFox. This code has been tested on a Win2003 server, IIS6, PHP 5.0.3, mySQL 4.1.8 and it works fine. The problem server is a Win2k server, IIS5, PHP 5.0.4, mySQL 4.1.11.
13
40770
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
5
4607
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post properly to the cgi and users get the message from IE that it "Cannot find server: The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to...
8
1717
by: Nathan Sokalski | last post by:
I have a form that submits data to a database. If I click the browser's refresh button after submitting the form once, the form is submitted a second time. How can I avoid this problem? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
5
1573
by: David | last post by:
Hi, I have an asp page which I am designing. On this page will be a set of records pulled from my db. These records will be displayed within a form. Each record will have a 'dropdown' displayed on the right hand side of each record, so the user can select 'Approved' or 'Scrap' for each seperate record. I then want the user to be able to submit this form to us by email.
4
2742
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc., when you select the cust id. Found this cited as a good method: http://www.mvps.org/access/forms/frm0058.htm I have two tables (clients, assignments) and one form (assignment input) in the database. I have a control box called CUST ID in the...
5
2550
by: plumba | last post by:
Hi all I have a form (see below), which for some reason has decided to stop functioning all together. It just does not call up the function. It is called up in the opening <form> tag but fails.... Any ideas??? <html> <head><title>New Details</title> </head> <center> <H2><IMG SRC="$(path)smlogo.gif"><br>
12
3843
by: colt28 | last post by:
Ok so I found an ajax contact form script but i can't get the b****** to work. I made a bunch of alterations to it and it didn't work so i replaced everything with the original and it still didn't work...dunno why, but anyhow. The form appears after a delay on the page in a hidden DIV. The original form just had name, email and message, but i have to add a few questions to it so i did and i also added some code from another script i found to...
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10259
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10238
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.