ioanna78
asked on
unable to execute URLEncodedFormat when using window.location.href in a javascript
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?answe r_text=#UR LEncodedFo rmat("+ans wer_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
<script>
function check_answer()
{
var answer_text=document.form1
<CFOUTPUT>
window.location.href="test
</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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points and the kisses!
Lol
Jimmy
Lol
Jimmy
ASKER
you were realy quick and helpful, i'll give you all my points (75).