Click to See Complete Forum and Search --> : Javascript round bracket


xuelin00
02-16-2003, 08:56 PM
Hi. Need some help here.

The following code is used:

<input type="button" value="Select" onclick="javascript:doChange('#getList.crs_code# - #getList.description#')">

And I will encountered an error: Unterminated string constant.

the error is due to the "Enter" value in the #getList.description#.

Does anyone know how to filter out the "Enter" value in the #getList.description#?

Thanks!

Dan Drillich
02-16-2003, 09:28 PM
Try this, it might help -


<script>
function doChange(v) {
//var v = unescape(v);
alert(v);

}

var v = escape("desc((");
var v = "de\n\rsc";

</script>



<input type="button" value="Select" onclick="doChange('#getList.crs_code# - '+v)">

xuelin00
02-16-2003, 09:42 PM
Hi Dan Drillich,

Thanks for the reply. :)

How do I add your codes to my existing doChange()?


function doChange(a){

parent.opener.opener.form.courseProj.value = a;
parent.opener.opener.opener.info.courseProjHcopy.value = a;

parent.window.close();
}