473,503 Members | 1,697 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="tableBackLgtBlue2">EMPLOYER CONTRIBUTION</td>
<td class="tableBackLgtBlue2"><select size="1" name="sel13A_Type">
<option value="">Select</option>
<option value="GBP">GBP</option>
<option value="Percent">Percent</option>
</select>

<input type="text" name="txt13_Employer_Contribution">

</td>

</tr>

<TR>





<TD class="tableBackLgtBlue2">EMPLOYEE CONTRIBUTION</td>
<td class="tableBackLgtBlue2"><select size="1" name="sel14A_Type">
<option value="">Select</option>
<option value="GBP">GBP</option>
<option value="Percent">Percent</option>
</select>

<input type="text" name="txt14_Employee_Contribution">


</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 1258
acoder
16,027 Recognized Expert Moderator MVP
Please use code tags when posting code, e.g.

[CODE=javascript]
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
3987
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
4177
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...
13
40624
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...
5
4587
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...
8
1703
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. --...
5
1564
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...
4
2728
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.,...
5
2529
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...
12
3794
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...
0
7074
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
7273
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,...
0
7322
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...
1
6982
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
7451
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
5572
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,...
1
5000
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...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
731
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.