Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2002-03-12
3
Medium Priority
?
406 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

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

610 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