473,383 Members | 1,853 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,383 software developers and data experts.

onsubmit replace string text by

Want to change text formatting in textarea with an onsubmit.

I have the script working with the onchange command as follows:

[HTML]<form action="message.php" method="post">
<table align="center" border="0" width="70%">
<tr><td width="30%">Subject:</td>
<td width="70%"><input type="text" name="subject" size="25" />
</td>
</tr>
<tr><td>Message:</td>
<td>
<textarea rows="8" name="message" cols="40" onchange="message1=this.value;message1=replace1(me ssage1);message.value=message1"> </textarea>

</td>
</tr>
<tr><td>
<div align="center"><input type="submit" name="submit" value="New E-Mail" class="buttonSubmit" /></div>
<input type="hidden" name="submitted" value="TRUE" />
</td></tr>

</table>
</form>
[/HTML]
So how do we do this with onsubmit ?(the results of the changes are submitted to a MySQl db.

Ian
Jun 14 '06 #1
4 3092
Banfa
9,065 Expert Mod 8TB
Have you tried just putting the same code in the onsubmit handler of the form ?
Jun 14 '06 #2
Yes.

but changed onchange for onsubmit.

Ian
Jun 14 '06 #3
Banfa
9,065 Expert Mod 8TB
And what happened? Why didn't it work?
Jun 14 '06 #4
acoder
16,027 Expert Mod 8TB
onsubmit is a form event, not a textarea, so it should be attached to the form tag.
Jun 22 '08 #5

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

Similar topics

5
by: K.Simon | last post by:
Hello, it's very often neccessary to replace strings or a single character in my stylesheets. My solution looks awful and very long. Now i thought to solve this with an array like structure but...
12
by: micahl0180 | last post by:
Ok, I am having trouble with the code below, but cannot seem to find the problem. When I run it, it says Object Expected" and points me to line 31: <form action="" method="post" name="payroll"...
2
by: Sean Dockery | last post by:
Which is the following is correct? a) <form ... onSubmit="return checkData()"> b) <form ... onSubmit="return checkData();"> c) <form ... onSubmit="checkData()"> d) <form ......
22
by: Phlip | last post by:
C++ers: Here's an open ended STL question. What's the smarmiest most templated way to use <string>, <algorithms> etc. to turn this: " able search baker search charlie " into this: " able...
4
by: Cor | last post by:
Hi Newsgroup, I have given an answer in this newsgroup about a "Replace". There came an answer on that I did not understand, so I have done some tests. I got the idea that someone said,...
10
by: Lonifasiko | last post by:
Hi, Just want to replace character at index 1 of a string with another character. Just want to replace character at that position. I thought Replace method would be overloaded with an index...
3
by: Hvid Hat | last post by:
Hi I want to highlight (make it bold) a word in some text I'm getting in XML format. My plan was to replace the word with a bold (or span) tag with the word within the tag. I've found the code...
8
by: Mark Livingstone | last post by:
I have a form that uses the following: onSubmit="some_var = 'validated';" FireFox is OK with that. Internet Explorer isn't. any ideas why? Thanks.
2
by: rudiedirkx | last post by:
Gents, I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/answers/166542-onsubmit-safari but not as detailed as...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.