|
Re: Can't seem to reference a form item [message #653206 is a reply to message #653155] |
Tue, 08 February 2011 21:05 |
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.02530 seconds