Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.all error

Status
Not open for further replies.

slatet

Programmer
Sep 11, 2003
116
US
I posted the following in another forum and was told it was the wrong one, am I in the correct one now?

I am getting an error on the document.all onclick. Is this doable, or do I need to use a different function.....?

Response.Write(&quot;<HTML><HEAD><TITLE> Due Date Range </TITLE></HEAD><BODY>&quot;)

Response.Write(&quot;<table align=&quot;&quot;center&quot;&quot;><tr>&quot;)
Response.Write(&quot;<td colspan=&quot;&quot;2&quot;&quot; align=&quot;&quot;center&quot;&quot;><b>Enter date range in the format mm/dd/yyy</b></td>&quot;)
Response.Write(&quot;</tr><tr><td>Start Date</td><td>&quot;)
Response.Write(&quot;<Input Type=&quot;&quot;textbox&quot;&quot; NAME=&quot;&quot;StartDate&quot;&quot; runat=&quot;&quot;server&quot;&quot; ID=&quot;&quot;StartDate&quot;&quot; />&quot;)
Response.Write(&quot;</td></tr><tr>&quot;)
Response.Write(&quot;</tr><tr><td>End Date</td><td>&quot;)
Response.Write(&quot;<Input Type=&quot;&quot;textbox&quot;&quot; NAME=&quot;&quot;EndDate&quot;&quot; runat=&quot;&quot;server&quot;&quot; ID=&quot;&quot;EndDate&quot;&quot; />&quot;)

'*****************************************************************************************************

Response.Write(&quot;</td></tr><tr>&quot;)
Response.Write(&quot;<td align=&quot;&quot;right&quot;&quot;>&quot;)
Response.Write(&quot;<INPUT TYPE=&quot;&quot;button&quot;&quot; NAME=&quot;&quot;btnOK&quot;&quot; VALUE=&quot;&quot; OK &quot;&quot; onClick=&quot;&quot;window.opener.FilterReportTasks(document.all.StartDate.value + &quot;&quot;*&quot;&quot; + document.all.EndDate.value);window.close();&quot;&quot;>&quot;)
Response.Write(&quot;</td><td align=&quot;&quot;right&quot;&quot;>&quot;)
Response.Write(&quot;<INPUT TYPE=&quot;&quot;button&quot;&quot; NAME=&quot;&quot;btnCancel&quot;&quot; VALUE=&quot;&quot;Cancel&quot;&quot; onClick=&quot;&quot;window.close();&quot;&quot;>&quot;)
Response.Write(&quot;</td>&quot;)
Response.Write(&quot;</tr>&quot;)
Response.Write(&quot;</table>&quot;)
Response.Write(&quot;</BODY></HTML>&quot;)
 
document.formName.fieldName.value = someValue

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
I will try mwolf00's suggestion but in the mean time.. I am trying to concatenate two textbox values together to send it back to a javascript function. (We are using someone else's code and are having lots of problems. I have posted several problems in several forums)
 
I believe it might be the &quot;&quot;*&quot;&quot; that I use to separate the dates. I just removed it and used it with the formname and I do not get an error.
 
Sorry to post AGAIN. But now I get an error when I click ok stating that document.Formname.startdate is null or not an object.
 
Response.Write(&quot;<INPUT TYPE=&quot;&quot;button&quot;&quot; NAME=&quot;&quot;btnOK&quot;&quot; VALUE=&quot;&quot; OK &quot;&quot; onClick=&quot;&quot;window.opener.FilterReportTasks(document.all.StartDate.value + &quot;&quot;*&quot;&quot; + document.all.EndDate.value);window.close();&quot;&quot;>&quot;)

sometimes it's easier to get away from the server side code (stop the delimiters)

%>
<INPUT TYPE=&quot;button&quot; NAME=&quot;btnOK&quot; VALUE=&quot; OK &quot; onClick=&quot;window.opener.FilerReportTasks(document.myForm.StartDate.value + '*' + document.myForm.EndDate.value); self.close()&quot;>
<%

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
Unfortunately I don't understand what you are suggesting when you put the %> in. I realize you are suggesting putting it on the client, but I currently do not have any %> anywhere in the code. So where would the opening one put be placed?
 
Isn't the code that you posted from an ASP page? If there are no delimiters, then you might have a <SCRIPT RUNAT=SERVER> somewhere at the beginning... If so, then it would be

</script>

<INPUT TYPE=&quot;button&quot; NAME=&quot;btnOK&quot; VALUE=&quot; OK &quot; onClick=&quot;window.opener.FilerReportTasks(document.myForm.StartDate.value + '*' + document.myForm.EndDate.value); self.close()&quot;>

<script runat=server language=vbs>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
It is actually from a .aspx. So no delimiters or script tags.
 
I see....

Response.write(&quot;<INPUT TYPE=&quot;&quot;button&quot;&quot; NAME=&quot;&quot;btnOK&quot;&quot; VALUE=&quot;&quot; OK &quot;&quot; onClick=&quot;&quot;window.opener.FilerReportTasks(document.myForm.StartDate.value + '*' + document.myForm.EndDate.value); self.close()&quot;&quot;>&quot;)

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
Even with this, I am still getting a &quot;document.myForm.StartDate is null or not an object&quot; error.
 
do you have a field named &quot;StartDate&quot; inside a form called &quot;myForm&quot;? (both names are CASE SENSITIVE)...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
Here are the two lines. I can't see any differences but I've been staring at it for so long.....

Response.Write(&quot;<Input Type=&quot;&quot;TextBox&quot;&quot; NAME=&quot;&quot;StartDate&quot;&quot; ID=&quot;&quot;StartDate&quot;&quot;>&quot;)

Response.Write(&quot;<INPUT TYPE=&quot;&quot;button&quot;&quot; NAME=&quot;&quot;btnOK&quot;&quot; VALUE=&quot;&quot; OK &quot;&quot; onClick=&quot;&quot;window.opener.FilterReportTasks(window.opener.FilterReportTasks(document.FilterDateRange.StartDate.value));self.close();&quot;&quot;>&quot;)
 
Finally got it. I had extra code in the button click and when I put it back to &quot;all&quot; instead of the form name, it fixed it.

Response.Write(&quot;<INPUT TYPE=&quot;&quot;button&quot;&quot; NAME=&quot;&quot;btnOK&quot;&quot; VALUE=&quot;&quot; OK &quot;&quot; onClick=&quot;&quot;window.opener.FilterReportTasks(document.all.StartDate.value);self.close();&quot;&quot;>&quot;)



Whew! Thanks for helping.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top