Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Can't seem to reference a form item
Can't seem to reference a form item [message #653155] Tue, 08 February 2011 12:30 Go to next message
Mike Wulkan is currently offline Mike Wulkan
Messages: 141
Registered: July 2009
Senior Member
Please forgive my newbie java script issues

I have a form:

<form name="optionsForm">
<INPUT TYPE=CHECKBOX NAME="showDateCheckbox" <VALUE-OF>if( params["ShowDate"].value){
"checked";
}else{
"";
}</VALUE-OF>>Show Date</INPUT>
</form>

and another form:

<form name="input" onSubmit="return reloadPage();">

<script type="text/javascript">
function reloadPage() {
alert("Reload time");
var temp = new String(location.href);
var targetURL = new String();

if(temp.indexOf("__overwrite=") != -1 ){
targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
}else{
targetURL = temp;
}
alert(targetURL);

targetURL += "&__overwrite=true";

targetURL += "&ShowDate=" + document.optionsForm.showDateCheckBox.checked;

alert( targetURL );
location.replace(targetURL);

return false;
}
</script>
</form>

the line
targetURL += "&ShowDate=" + document.optionsForm.showDateCheckBox.checked;
appears to be failing but I'm not sure why?

I don't see any errors but I also don't see the second "alert". If I take out this line I see both alerts.
1) Why is this failing?
2) how does one debug these silent errors in general?
Re: Can't seem to reference a form item [message #653206 is a reply to message #653155] Tue, 08 February 2011 16:05 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Mike

The check box is named
showDateCheckbox
not
showDateCheckBox

Note the b in box.

Jason

On 2/8/2011 12:30 PM, Mike Wulkan wrote:
> Please forgive my newbie java script issues
>
> I have a form:
> <form name="optionsForm">
> <INPUT TYPE=CHECKBOX NAME="showDateCheckbox" <VALUE-OF>if(
> params["ShowDate"].value){
> "checked";
> }else{
> "";
> }</VALUE-OF>>Show Date</INPUT>
> </form>
>
> and another form:
>
> <form name="input" onSubmit="return reloadPage();">
>
> <script type="text/javascript">
> function reloadPage() {
> alert("Reload time");
> var temp = new String(location.href);
> var targetURL = new String();
> if(temp.indexOf("__overwrite=") != -1 ){
> targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
> }else{
> targetURL = temp;
> }
> alert(targetURL);
>
> targetURL += "&__overwrite=true";
>
> targetURL += "&ShowDate=" + document.optionsForm.showDateCheckBox.checked;
>
> alert( targetURL );
> location.replace(targetURL);
>
> return false;
> }
> </script>
> </form>
>
> the line targetURL += "&ShowDate=" +
> document.optionsForm.showDateCheckBox.checked;
> appears to be failing but I'm not sure why?
>
> I don't see any errors but I also don't see the second "alert". If I
> take out this line I see both alerts.
> 1) Why is this failing?
> 2) how does one debug these silent errors in general?
Previous Topic:How to print a report with PrintDialog
Next Topic:GenReport.sh with scripted datasource
Goto Forum:
  


Current Time: Sun Aug 31 00:41:35 EDT 2014

Powered by FUDForum. Page generated in 0.01621 seconds