|
-
December 30th, 2008, 01:22 PM
#1
Getting Javascript error when i open popup.
Hi,
I am getting javascript error when i try to open a small calendar popup window. I have one calender text field. beside that text field calendar icon is there. when i click on that icon it's not open the small calendar popup. it is showing the following error in firebug console i.e " document.updateContact.birthYear is undefined"
i wrote the following code in java class.
Code:
if ( k.equals("BIRTHDAY") )
{
String birthDay = "", birthYear = "";
if ( psn != null && psn.getBirthDate() != null )
{
String birthDateYear = psn.getBirthDate().trim();
if ( birthDateYear != null && birthDateYear.length() == 10 ) // MM.DD.YYYY
{
birthYear = birthDateYear.substring(6);
birthDay = birthDateYear.substring(0,5);
}
else if ( birthDateYear != null && birthDateYear.length() == 11 ) // MON.DD.YYYY
{
birthYear = birthDateYear.substring(7);
birthDay = birthDateYear.substring(0,6);
}
else if ( birthDateYear != null && birthDateYear.length() == 6 ) // MON.DD
{
birthDay = birthDateYear;
}
else if ( birthDateYear != null && birthDateYear.length() == 5 ) // .YYYY, or 07.20
{
if ( birthDateYear.startsWith(".") ) birthYear = birthDateYear.substring(1);
else birthDay = birthDateYear;
}
}
buf.append( "<input type=text class=\""+className+"\" name=birthDay size=6 value=\""+birthDay+"\">" );
buf.append( " <img onMouseUp=\"javascript:opencalBD(document."+formName+".birthYear.value+'.'+document."+formName+".birthDay.value);\" src=\"graphics/ozicon18cal.gif\" align=absmiddle>" );
buf.append( " , <input type=text class=\""+className+"\" name=birthYear size=4 value=\""+birthYear+"\">" );
buf.append( " <span class=calDayFmtGreen>(MON.DD,YYYY)</span>" );
buf.append( "<input type=hidden name=__BIRTHDAY value=Y>" );
return buf.toString();
}
can any body give an idea on this ??
Thanks in advance..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|