Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

My code is not working

  Asked By: Amolika Bhatt         Date: Dec 14, 2009      Category: Sharepoint      Views: 151
 

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.


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:          

 

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.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].