WorkerBeeJ
Programmer
I'm trying to do a string replace but am having some trouble. Here's the code:
<script language="javascript">
<!--
function openWindow(page) {
var txtDate;
txtDate = document.all("txtReportMonth".value;
txtDate = getURLDate(txtDate);
page = page + txtDate;
document.window.open(page,'ReportWindow','width=500,height=500');
}
function getURLDate(txtDate) {
var newDate = txtDate.Replace(/\u002F/g, "_"
return newDate;
}
//-->
</script>
I believe there's a problem with the line:
var newDate = txtDate.Replace(/\u002F/g, "_"
I'm trying to replace the slashes in a date with underscores so that I can pass it in a URL.
Anyone know how I can fix this?
Thanks!
<script language="javascript">
<!--
function openWindow(page) {
var txtDate;
txtDate = document.all("txtReportMonth".value;
txtDate = getURLDate(txtDate);
page = page + txtDate;
document.window.open(page,'ReportWindow','width=500,height=500');
}
function getURLDate(txtDate) {
var newDate = txtDate.Replace(/\u002F/g, "_"
return newDate;
}
//-->
</script>
I believe there's a problem with the line:
var newDate = txtDate.Replace(/\u002F/g, "_"
I'm trying to replace the slashes in a date with underscores so that I can pass it in a URL.
Anyone know how I can fix this?
Thanks!