Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

My code is not working

  Asked By: Amolika    Date: Dec 14    Category: Sharepoint    Views: 845

I'm having 2 major problems right now. I'm trying to modify the
announcements web part to have today's current date appear as a
default in the Start Date field. This is my code:


<script>var frm=new OWSForm("OWSForm",true,"", "");
var MyDate = new Date
var ThisYear = MyDate.GetYear()</script>

This is how I'm trying to grab the current date. I'm trying to have
it appear here:

<SCRIPT>

fld = new DateField(frm,'<xsl:value-of
select="@fieldname"/>','<xsl:value-of
select="@name"/>',ThisYear);fld.fDateOnly = false;fld.BuildUI();
</SCRIPT>*This is a required field

but nothing appears. The strange thing is if I hard code a date into
the ThisYear variable it does appear in the dynamically created date
text input field. I've tried changing the my variable to read like
this: var ThisYear = MyDate.GetYear().toString but this does not work
either.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on My code is not working Or get search suggestion and latest updates.




Tagged: