calender control in asp.net opening in another form -
i using calender control in asp.net 2.0, , after clicking on button opening in form. using following js code open window:
function openwindow(txtvalueid) { leftval = (3500 - screen.width) / 2; topval = (800 - screen.height) / 2; if (txtvalueid == 'ctl00$cph1$txthiredate') { var txtid = '<%=txthiredate.clientid %>'; } else { var txtid = '<%=txttermdate.clientid %>'; } var frmid = '<%=page.form.clientid %>'; var qs = "formname=" + frmid + "." + txtid; window.open('/calender.aspx?' + qs, 'calendar_window', 'fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=230,height=240,left=' + leftval + ',top=' + topval + ',screenx=400,screeny=400') } function isnumeric(keycode) { return ((keycode >= 48 && keycode <= 57) || keycode == 8) } in line txtvalueid == 'ctl00$cph1$txthiredate' wrong. referring control id, control id keeps changing.. why?
you shouldn't explicitly refer id directly, instead do:
if (txtvalueid == '<%=txthiredate.clientid %>') { in first if line, id changing issue.
hth.
Comments
Post a Comment