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

Moving variable form Javascript to PHP?

Hello to all,

I just downloaded the cross-browser rich text editor from
Kevin Roth. http://www.kevinroth.com/rte/demo.htm

Sample fo the html code:
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
//call updateMessage to
updateRTE();
alert(document.RichTextEditor.msgbody.value);

//change the following line to true to submit form
return true;
}
//-->
</script>

The code shown a pop up alert box!

I'm not using javascript, but I like to know, how can I get
the value in a PHP $variable to save It in a MySQL table.

Many thanks in advance for your help.

Thanks.

Otto

Jul 17 '05 #1
2 5052
jn

"Otto Haldi" <oh****@freesurf.ch> wrote in message
news:VA******************@freesurf.ch...
Hello to all,

I just downloaded the cross-browser rich text editor from
Kevin Roth. http://www.kevinroth.com/rte/demo.htm

Sample fo the html code:
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
//call updateMessage to
updateRTE();
alert(document.RichTextEditor.msgbody.value);

//change the following line to true to submit form
return true;
}
//-->
</script>

The code shown a pop up alert box!

I'm not using javascript, but I like to know, how can I get
the value in a PHP $variable to save It in a MySQL table.

Many thanks in advance for your help.

Thanks.

Otto


Change the form action to a PHP script that will handle your input. Take out
the "alert" line in the javascript. When you submit the form, the variable
will be passed to your PHP script in the post array as $_POST['msgbody']

HTH
Jul 17 '05 #2
Many thanks four your quick answer.
Change the form action to a PHP script that will handle your input. Take out
the "alert" line in the javascript. When you submit the form, the variable
will be passed to your PHP script in the post array as $_POST['msgbody']


I still have a small question, witch variable should I read in
$_POST['msgbody']?

Here the all form:
<form name="RichTextEditor" action="" method="post" onsubmit="return
submitForm();">
<?php include "includes/rte.php"; LoadRTE("msgbody", $sContent, "", "", true);
?>

<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
//call updateMessage to
updateRTE();
// alert(document.RichTextEditor.msgbody.value);
return true;
}
//-->
</script>

<p><input type="submit" name="submit" value="Enregistrer"></p>
</form>

Regards

Otto

Jul 17 '05 #3

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

Similar topics

10
by: R.G. Vervoort | last post by:
I am using a javafunction (onclick in select) in which i am calling a function in php (thats why i send this to both php and javascript newsgroups). in the onclick i call the function...
1
by: Andi B | last post by:
Hi everyone. I have a quick question - if I have a form which refers to a javascript when its submitted using: <form name = "fred" onsubmit = "test()"> and this function creates a popup...
5
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
1
by: Larry L | last post by:
I'm pretty novice at javascript, and it took me this long to understand what is happening in my page so far. On my page I do several things, requiring user input, to create a variable that I...
2
by: umashd | last post by:
Hi, I am doing a web based project for my graduation. I studied bit of java for backend processesing and javascript for the client. Here is the scenario. In the FORM, I use INPUT TYPE=text...
1
by: stephane | last post by:
I have a problem which must be in this : print" <script type='text/javascript'> document.location.replace('http://127.0.0.1/add_task.php?req_id={$maxValue}&tk_request_name={$req_name}');...
14
by: rabbitrun | last post by:
Hi Everyone, I work for a financial company. I am planning to give a presentation to rest of the development team (15 people) here on moving server side logic to client-side javascript for an...
1
by: madflytom | last post by:
Hello, I'm trying to move the options of one select list to another select list. The "source" select list is divided into optgroups, and the "target" select list is not. I want to somehow keep...
5
by: quirk | last post by:
I am trying to write a script where a page is populated with some maths questions, user answers them (it's timed but I've left this bit out), gets results on same page and ajax takes their score,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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?
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
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,...
0
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,...

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.