By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,045 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,045 IT Pros & Developers. It's quick & easy.

Javascript Form - Gathering/consolidating field input issue

P: 1
In this emal form, I'm trying to consolidate all the input into the TEXTAREA portion and then have it emailed to a specific person. I've tried the onClick and onBlur commands but only one field's input shows at a given time in the TEXTAREA box. Then, then when I move to the next field and input text, it just erases the choice from the first field in the TEXTAREA box below.

Basically, I want the data to consolidate in the TEXTAREA box and then when I click Submit, it will be emailed to me. The text should look like this in the TEXTAREA box and in the final email body:

Bob Smith
bob.smith@company.com
USA
Foxtrot, Samba


Thanks everyone,
Joe


Here is the code:

Expand|Select|Wrap|Line Numbers
  1. <form enctype="application/x-www-form-urlencoded" name="mailform" action="%SCRIPTURL{sendemail}%/%WEB%/%TOPIC%" method="POST">
  2.  
  3. <h1><a name="Registration"></a> Dance Class Registration </h1>
  4.  
  5. <table border="0" cellpadding="0" cellspacing="12">
  6.  
  7. <td></td>
  8.   <td>Fields marked <code><font color='red'>**</font></code> are required</td>
  9. </tr>
  10.  
  11. <tr>
  12.   <td align="right"> Name: </td>
  13.   <td><input type="text" name="Name" size="40" class="twikiInputField" value="" /><code><font color="red">**</font></code> </td>
  14. </tr>
  15.  
  16. <tr>
  17.   <td align="right"> E-mail address: </td>
  18.   <td><input type="text" name="Email" size="40" class="twikiInputField" value="" /> <code><font color="red">**</font></code> </td>
  19. </tr>
  20.  
  21. </tr><tr>
  22.   <td align="right"> Country: </td>
  23.   <td>
  24.   <select name="Country" size="1" />
  25.   <option selected value="">Select...</option>
  26.   <option>USA</option>
  27.   <option>Albania</option>
  28.   <option>Algeria</option>
  29.   <option>Andorra</option>
  30.   <option>Angola</option>
  31.   <option>Argentina</option>
  32.   <option>Armenia</option>
  33.   <option>Aruba</option>
  34.   <option>Australia</option>
  35.   <option>Austria</option>
  36.   <option>Azerbaijan</option>
  37.   <option>Bahrain</option>
  38.   <option>Bangladesh</option>
  39.   <option>Belarus</option>
  40.   <option>Belgium</option>
  41.   <option>Belize</option>
  42.   <option>Benin</option>
  43.   <option>Bhutan</option>
  44.   <option>Bolivia</option>
  45.   <option>Bosnia and Hercegovina</option>
  46.   <option>Brazil</option>
  47.   <option>Bulgaria</option>
  48.   <option>Burundi</option>
  49.   <option>Cambodia</option>
  50.   <option>Cameroon</option>
  51.   <option>Canada</option>
  52.   <option>Central African Republic</option>
  53.   <option>Chile</option>
  54.   <option>China</option>
  55.   <option>Colombia</option>
  56.   <option>Congo</option>
  57.   <option>Costa Rica</option>
  58.   <option>Croatia</option>
  59.   <option>Cuba</option>
  60.   <option>Cyprus</option>
  61.   <option>Czech Republic</option>
  62.   <option>Denmark</option>
  63.   <option>Ecuador</option>
  64.   <option>Egypt</option>
  65.   <option>El Salvador</option>
  66.   <option>Estonia</option>
  67.   <option>Ethiopia</option>
  68.   <option>Fiji</option>
  69.   <option>Finland</option>
  70.   <option>France</option>
  71.   <option>Georgia</option>
  72.   <option>Germany</option>
  73.   <option>Gibraltar</option>
  74.   <option>Greece</option>
  75.   <option>Guam</option>
  76.   <option>Guatemala</option>
  77.   <option>Haiti</option>
  78.   <option>Hong Kong</option>
  79.   <option>Hungary</option>
  80.   <option>Iceland</option>
  81.   <option>India</option>
  82.   <option>Indonesia</option>
  83.   <option>Iran</option>
  84.   <option>Iraq</option>
  85.   <option>Ireland</option>
  86.   <option>Israel</option>
  87.   <option>Italy</option>
  88.   <option>Jamaica</option>
  89.   <option>Japan</option>
  90.   <option>Jordan</option>
  91.   <option>Kazakstan</option>
  92.   <option>Kenya</option>
  93.   <option>Korea</option>
  94.   <option>Kuwait</option>
  95.   <option>Kyrgyz Rebublic</option>
  96.   <option>Laos</option>
  97.   <option>Latvia</option>
  98.   <option>Lebanon</option>
  99.   <option>Liberia</option>
  100.   <option>Liechtenstein</option>
  101.   <option>Lithuania</option>
  102.   <option>Luxembourg</option>
  103.   <option>Libya</option>
  104.   <option>Macao</option>
  105.   <option>Macedonia</option>
  106.   <option>Malaysia</option>
  107.   <option>Malawi</option>
  108.   <option>Malta</option>
  109.   <option>Mauritius</option>
  110.   <option>Mexico</option>
  111.   <option>Moldova</option>
  112.   <option>Monaco</option>
  113.   <option>Morocco</option>
  114.   <option>Mozambique</option>
  115.   <option>Namibia</option>
  116.   <option>Nepal</option>
  117.   <option>Netherlands</option>
  118.   <option>New Zealand</option>
  119.   <option>Nicaragua</option>
  120.   <option>Nigeria</option>
  121.   <option>Norway</option>
  122.   <option>Oman</option>
  123.   <option>Pakistan</option>
  124.   <option>Panama</option>
  125.   <option>Paraguay</option>
  126.   <option>Peru</option>
  127.   <option>Philippines</option>
  128.   <option>Poland</option>
  129.   <option>Portugal</option>
  130.   <option>Romania</option>
  131.   <option>Russia</option>
  132.   <option>Saudi Arabia</option>
  133.   <option>Senegal</option>
  134.   <option>Singapore</option>
  135.   <option>Slovakia</option>
  136.   <option>Slovenia</option>
  137.   <option>South Africa</option>
  138.   <option>Spain</option>
  139.   <option>Sri Lanka</option>
  140.   <option>Suriname</option>
  141.   <option>Sweden</option>
  142.   <option>Switzerland</option>
  143.   <option>Syria</option>
  144.   <option>Taiwan</option>
  145.   <option>Tanzania</option>
  146.   <option>Thailand</option>
  147.   <option>Tajikistan</option>
  148.   <option>Tunisia</option>
  149.   <option>Turkey</option>
  150.   <option>Turkmenistan</option>
  151.   <option>Uganda</option>
  152.   <option>Ukraine</option>
  153.   <option>United Arab Emirates</option>
  154.   <option>United Kingdom</option>
  155.   <option>Uruguay</option>
  156.   <option>USA</option>
  157.   <option>Uzbekistan</option>
  158.   <option>Vatican City</option>
  159.   <option>Venezuela</option>
  160.   <option>Vietnam</option>
  161.   <option>Yemen</option>
  162.   <option>Yugoslavia</option>
  163.   <option>Zaire</option>
  164.   <option>Zambia</option>
  165.   <option>Zimbabwe</option>
  166.   <option value="Other Country">Other Country</option>
  167.   </select> <code><font color="red">**</font></code>
  168.   </td>
  169. </tr>
  170.  
  171. </tr><tr>
  172.   <td align="right"> Type of Dance: </td>
  173.   <td>
  174.   <Input type=radio class="twikiInputField" name="class1" value="Foxtrot" />Foxtrot
  175.   <Input type=radio class="twikiInputField" name="class2" value="Mambo" />Mambo
  176.   <Input type=radio class="twikiInputField" name="class3" value="Samba" />Samba
  177.   <Input type=radio class="twikiInputField" name="class4" value="Swing" />Swing
  178.   <Input type=radio class="twikiInputField" name="class5" value="Waltz" />Waltz
  179.   <Input type=radio class="twikiInputField" name="class6" value="Other">Other Dance (indicate in the Message section below)
  180.   </td>
  181. </tr>
  182.  
  183. <p><input type=hidden input class="twikiInputField" id="to" name="to" size="30" type="text" value="xxxxx@xxxxxxx.com" /></p>
  184.  
  185. <p><input type=hidden class="twikiInputField" id="subject" name="subject" size="30" value="Dance Class Registration" /></p>
  186.  
  187. <tr>
  188.   <td valign="top" align="right"> CC: (optional)<br /> </td>
  189.   <td><input type="text" class="twikiInputField" id="cc" name="cc" size="40"  value="" /></td>
  190. </tr>
  191.  
  192. <tr>
  193.   <td valign="top" align="right"> Message: <br /> </td>
  194.   <td><textarea class="twikiInputField" cols="40" name="body" rows="6" ></textarea></td>
  195. </tr>
  196.  
  197. </table>
  198.  
  199. <h5><a name="Check"></a> Verify that the information above is correct and click below to register. </h5>
  200.  
  201. <p><input type="submit" class="twikiSubmit" value="Register" %IF{"context SendEmailPluginEnabled" then='' else='disabled="disabled"'}% /></p>
  202.  
  203. %SENDEMAIL{feedbackSuccess="Successfully sent" feedbackError="Something went wrong." }%
  204.  
  205. </form>
Oct 10 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
You need to add to the textarea value rather than reset the value. You could use +=. For the newline, use "\n".
Oct 15 '07 #2

Post your reply

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