Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Can't seem to reference a form item
Can't seem to reference a form item [message #653155] Tue, 08 February 2011 17:30 Go to next message
Mike Wulkan is currently offline Mike WulkanFriend
Messages: 147
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 21:05 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
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: Thu Apr 25 23:10:26 GMT 2024

Powered by FUDForum. Page generated in 0.03715 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top