0

I have a Textarea, and I want to store value in a variable.
The condition is that the value will be fetch from JS that is Document.FormName.Combox1.Value in the same page. I know $_POST method..

2
Contributors
11
Replies
14
Views
6 Years
Discussion Span
Last Post by abhi10kumar
Featured Replies
  • It looks like you would be needing AJAX. That would be a way to send the data from the HTML page to PHP using Javascript. I would utilize the GET or POST methods, but the page will not refresh. Is there a reason you do not want to use POST. … Read More

0

Your question is not very clear. Could you please clarify if you want to get the data into a JavaScript variable or a PHP variable.

Thanks.

0

If you want to transfer the value of the textarea to PHP with page refresh use $_POST['textarea'] which you already said you know.

If you want to do it without refreshing the page then you would need AJAX.

0

Actually, I want to store that value into the database. Using script, the textarea's value that I needed; not by using $_POST, there is any solution to do this.

1

It looks like you would be needing AJAX. That would be a way to send the data from the HTML page to PHP using Javascript. I would utilize the GET or POST methods, but the page will not refresh. Is there a reason you do not want to use POST.

If you can give me a heads up on what application you are trying to build I'll probably be able to suggest a solution.

Check out http://www.w3schools.com/ajax/default.asp for an AJAX tutorial. Might be you'll find what you are looking for.

Edited by sudeepjd: n/a

Votes + Comments
Genious
0

I have form where there is WYSIWYG text area, that contain formatted textarea content, when I use POST it gives only simple value; I need all HTML tags that used to format the text, because that formatted text have to send into emails id using MIME format. I got the value document.from.combox1.value. I am attached an image.

Attachments untitled.JPG 19.23 KB
0

Are you sure that document.from.combox1.value has the value with the html tags?

In see if you use alert(document.from.combox1.value) and see if you are getting the value with the tags as well. If not then you need to see the documentation of the WYSIWYG editor and check as to what you need to use.

If you let me know which editor you are using, I'll check the documentation for you.

0

Yes, alert(document.form.combobox1.value) is showing the value with all tags; but not in POST method. I am using MICROSOFT Expression Web 2.0

I am attaching the whole project.

tinymce/examples/a.php is the page, when you click the submit button you will see the all in the alert box..

0

I checked it and I am getting the html tags in the post method. Put the following at the top of the file and check.

<?
	$val=$_POST['elm1'];
	echo htmlentities($val);
?>

When you submit the form, it will print the HTML code on the top of the page. I suppose you can use the same to put it into the DB.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.