?
Solved

unable to execute URLEncodedFormat when using window.location.href in a javascript

Posted on 2002-03-12
3
Medium Priority
?
405 Views
Last Modified: 2013-12-24
i have an html form in a cfm file and i want to get the value of a textarea before the form is submited, so i use a javascript to get this value and to reload the file the passed through the URL. the textarea may have special characters so i must use URLEncodedFormat, the problem is that when i use this it returns the name of the variable not the value. see the code bellow:

<script>
function check_answer()
{
var answer_text=document.form1.textarea1.value;
<CFOUTPUT>
window.location.href="test.cfm?answer_text=#URLEncodedFormat("+answer_text+")#";
</CFOUTPUT>
}
</script>

when i print the answer_text in test.cfm i get +answer_text+

i don't have any problem to use another method in order to get the value of the textarea

any help is welcome ioanna
0
Comment
Question by:ioanna78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
jimmy282 earned 300 total points
ID: 6856891
<script>
function check_answer()
{
var answer_text=document.form1.textarea1.value;
window.location.href="test.cfm?answer_text= + escape(answer_text);
}
</script>

This may help.
Jimmy

0
 

Author Comment

by:ioanna78
ID: 6857035
10000000000000 kisses!!!!!!!!!
you were realy quick and helpful, i'll give you all my points (75).
0
 
LVL 11

Expert Comment

by:jimmy282
ID: 6857056
Thanks for the points and the kisses!

Lol

Jimmy
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question