Javascript , date Field change doesn't work

I want to display the expiration date automatically as soon as I selected a date of issue but it does not work..
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader"><nobr>StartDate</nobr></H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff2{$Pos}" ControlMode="New" FieldName="StartDate" __designer:bind="
{ddwrt:DataBind('i',concat('ff2',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@StartDate')}"/>
<Sha
rePoint:FieldDescription runat="server" id="ff2description{$Pos}" FieldName="StartDate" ControlMode="New"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader"><nobr>EndDate</nobr></H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="New" FieldName="EndDate" __designer:bind="
{ddwrt:DataBind('i',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@EndDate')}"/>
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}" FieldName="EndDate" ControlMode="New"/>
</td>
</tr>
<script type="text/javascript" src="../../JQuery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
alert (&quot;Test&quot;);
   $(&apos;#ff2&apos;).change(function(){
   alert (&quot;Test&quot;);
       var startVal = $(this).val();
var month = startVal.getMonth();
var day = startVal.getDate();
var year = startVal.getFullYear();
year = year  + 1;
endVal= day+&apos;/&apos;+&apos;month&apos;+&apos;/&apos;+&apos;Year&apos;;
       $(&apos;#ff3&apos;).val(endVal);
</script>

Hi,
Please add the following code into the new form page. You can also add a content editor web part into the new form page and add the code into the web part.
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("input[title='Start Date']").blur(function () {
var startVal = $(this).val();
var startDate = new Date(startVal);
var month = startDate.getMonth() + 1;
var day = startDate.getDate();
var year = startDate.getFullYear() + 1;
$("input[title='End Date']").val(month + "/" + day + "/" + year);
</script>
Or here is a thread talk about the similar issue for your reference:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_27765240.html
Best Regards
Dennis Guo
TechNet Community Support

Similar Messages

  • Bug: Sql Developer v1.2.1 (32.13) - Date Field Editor doesn't work properly

    Version: Sql Developer v1.2.1 (32.13)
    OS: Windows XP SP2
    Database: Oracle 10g
    Symptoms:
    I have a table with a DATE field.
    In a record of this field a have a value such as : 12/31/0003 (I know this is a strange date value) but the problem is that if I try to change this value using SqlDeveloper grid editor in 12/31/2003, it seems to not recognize the change without enabling the Commit Button and keeping the 0003 value !

    OK, I'm not understanding you exactly. It's not the formatting that you're having an issue with, but the editor. I have a date for a record that is 17-Feb-2006 and I want it to be 17-Feb-1996, so I invoke the date editor and highlight just the year and make the change. Just type in the new year and say OK. This then causes the Commit button to become available, because we have made a change and then I commit the record.
    The record is committed correctly, with the correct years, regardless of whether I have the formatting as RR, RRRR, YY or YYYY.
    Sue

  • Formatted Search for Delivery Date field in SO not working

    Hi All
    Can anyone help me as to why my formatted search is not working?
    I am currently using SAP B1A SP01 Patch 19.
    I have created a user query as follows:
    SELECT $ [$10.0.DATE] + 5
    When I add this to the delivery field within the Sales Order and bring through the saved query which I set to auto refresh when the Posting Date field changes and to Display Saved Values it doesn't work.
    Any ideas?
    Thanks and best wishes
    Gail

    HI Gail,
    If I am not mistaken you want to add days to the posting date...if that is so then try this out:
    SELECT $[ORDR.DocDate.DATE]+5 From ORDR T0 For Browse
    Set The indicator to Auto Refresh when the fields change
    Nagesh

  • XML Changer doesn't work in Firefox works in Internet Explorer

    Hi
    Can anyone help me i have a XML Changer doesn't work in Firefox works in Internet Explorer.
    I have posted the page here http://www.endeavourcfl.co.nz/Venues.html as you can see my other flash files work fine, it is only the XML Changer (no pictures appear at all), it was working previously but for some reason it has stopped have tried on many computers, all plugins are up to date and i have FF versions 16 and 17

    Its working fin in latest version of Firefox. <br>
    Update your Firefox <br>
    http://www.mozilla.org/en-US/firefox/all.html
    <br><br><br>
    Please check if all your plugins are up-to-date. To do this, go to the [http://mozilla.com/plugincheck Mozilla Plugin Check site].
    Once you're there, the site will check if all your plugins have the latest versions.
    If you see plugins in the list that have a yellow ''Update'' button or a red ''Update now'' button, please update these immediately.
    To do so, please click each red or yellow button. Then you should see a site that allows you to download the latest version. Double-click the downloaded file to start the installation and follow the steps mentioned in the installation procedure.

  • Bought a new Mac, migrated data, now CS4 doesn't work. Why?

    I bought a new Mac, had the Apple guys migrate my data and apps to it. Now CS4 doesn't work.
    I researched a bit and found that I SHOULD have deactivated and uninstalled CS4 from my old Mac. I've now done that.
    But do I have to uninstall CS4 files from my new Mac now--and reinstall? Will that work?

    Hi,
    I have a question related to one you answered above: "bought a new Mac, migrated data, now CS4 doesn't work."
    My situation is a little different. I am hoping you can help me with it. I hope I am not violating any protocols by asking you specifically?  A year ago I reinstalled my Mac's operating system. My CS4 is on my computer under "Previous System." I am unable to open it from there and I do not want to attempt migrating it for reasons noted above. I did try to reinstall it as you suggested to hbrady67 by dowloading from CS4 products with my serial number but I got this message: "Upgrade Check  We looked in the default location for qualifying products installed on the machine, but none were found. You may verify upgrade eligibility now by completing the fields to the right. 1) Select a product you already own. 2) Enter a serial number for this product.  CS4 wasn't in the list of selections. The protocol suggested won't work for me since I am not doing an upgrade but trying to reinstall what I already have. Can you direct me on where to go/what to do?  Thank you very much.      Bergi.
    I found the solution to this problem. I was able to download the trial version of what I have and enter the serial number from there. However, it still asked for a serial number from previous software: "your setup is for an upgrade version of Adobe Creative Suite 4." (I entered the serial number that I have for CS2. And it was accepted.  Thank you.  Bergi

  • When I use Mail and want to paste an emailadress with a right mouse click in the adres field this doesn't work, ofcourse cmd V  works. How can I solve this

    when I use Mail and want to paste an emailadress with a right mouse click in the adres field this doesn't work, ofcourse cmd V  works. How can I solve this

    YAY!  That did it.
    Thank you so much.
    And a Very Happy and Prosperous New Year to you!
    bonnie

  • Data Driven Test doesn't work in coded UI

    Hi,
    I have written my first coded ui data driven test (Visual Studio 2012).  Although the test ran and was marked passed. I don't think it actually did anything.  
    I have 2 fields (Input and Output) on my csv file.
    n my app,  I want to enter the input field in a field called GoTo which is an UITbedit field, hit enter.  This should open another window where I want to validate the window title = to my Output 
    Here is my code
            [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\Data/MainData.csv", "MainData#csv", DataAccessMethod.Sequential), DeploymentItem("MainData.csv"), TestMethod]
            public void DataDrivenTest()
                //string paramVal = TestContext.DataRow["Input"];
                this.UIMap.EnterGoToValueMainParams.TextInputEditText =
                    TestContext.DataRow["Input"].ToString();
        this.UIMap.EnterGoToValueMain();
                this.UIMap.PressEnter();
                this.UIMap.AssertWindowTitleExpectedValues.TextOutputEditText =
                    TestContext.DataRow["Output"].ToString();
    During playback, it appeared that the coded ui test had looped through the csv file, but it didn't actually write anything to the edit field that I was testing.

    It still doesn't work,
    I modified my code as follows:
                this.UIMap.EnterGoToValueMainParams.TextInputEditText =
                       TestContext.DataRow["Input"].ToString();
                this.UIMap.EnterGoToValueMain();
                this.UIMap.PressEnter();
                this.UIMap.AssertWindowTitleExpectedValues.TextOutputEditText =
                       TestContext.DataRow["Output"].ToString();
                this.UIMap.AssertWindowTitle();
    The application appears to loop through the file, but it is placing my original entered test "1" in the edit field during both iterations.  The playback is slow enough that I can see what is being entered. It doesn't seem to be replacing the
    "1" with a "5" from my input file.

  • TFS 2012 Update 4 - Build Alert - "A build controller or agent's status changes" doesn't work correctly

    We are running TFS2012 Update 4 and have set up some build alerts.  The alert we have set up is "A build controller or agent's status changes".  When this alert is first set up the default filters which are included are for fields "Team
    Project" and "Status".  However through much testing we have discovered that when either of these fields are included as a filter the alert doesn't work.  When other fields are used in the filter the alert works fine (as long
    as neither of the stated fields are included), indeed if all alert filters are removed then the alert also works successfully.  Has anyone else experienced this?  Is there an issue with the fields "Team Project" and "Status"?

    Hi T Quinn,   
    Thanks for your post.
    I reproduced this scenario in my TFS 2012 Update 4 Server and received the same result.
    For this scenario, please submit it to Microsoft Connect Feedback portal at:
    https://connect.microsoft.com/VisualStudio. Microsoft engineers will evaluate them seriously. 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SelectedIndex change doesn't work.

    I'm trying to change the selectedIndex of a combo using spry in this way Spry.$$("#combo").selectedIndex, but it doesn't work. Any idea why it doesn't?
    Thanks
    Andrea

    seoinabruzzo wrote:
    Ok thanks for the clarification, also if this get me confused a bit, because all the code I wrote use the Spry.$$("#comboProdotti") etc, because I was thinking that just using # in front of the name was enough to let Spry undestand I was referering to an object ID.
    And technically this is right, because currently my code is working, but it shouldn't because in the code I never accessed to the object in an array style.
    Have a look at www.cofofaniabruzzo.it/js/product.js
    So what's the best method to use?
    Let me try to say what I understood Single object, use the Spry.$, more than one object that use a class use the Spry.$$. Is this right? In both cases I should be able to get access to HTML tags, is this right again?
    Regarding to my original question, as per your suggestion, in both way I'm able to get the selectedIndex property, but if I try to alter the value, it seems that it's ignored.
    What i'd like to achieve is move the selectedIndex to 0. Technically this is right for any W3C compatible browser. Guess what? IE point the combo on the last item, while display the first element in the combo. That why I was trying to alter it.
    I tried also to use an object observer
        dsProductsObserver.onPostLoad = function(dataSet, data) { Spry.$('combo').selectedIndex = 0; };
    but in this context the Spry.$ is not accessible. Why not?
    Thanks
    Andrea
    Hello,
    Your site doesn't work. Is it maybe behind a firewall?
    If you want to target only one node that has an id attribute on it, its best to use the Spry.$ function, for all others you can use the Spry.$$ element selector.
    Heres some info about the Spry selectors : http://labs.adobe.com/technologies/spry/articles/element_selector/index.html
    What i alway do to select certain elements is this:
    var element = Spry.$('combo'),
         target = 'name';
    for(var i = 0; i < element.length; j++){
         if(element[i].value == target){
              element[i].selectedIndex = i;
    If the value is the name as our target it will select that. This will probably help you out with your IE issue. Just change 'name' in to the value of your first option. And it should be selected.

  • "Move Current Track Automation Data to Region" doesn't work for all

    I have been using the 'Move Current Track Automation Data to Region' and while it works fine for some types of automation data like channel volume, pan and some plugin parameters, it doesn't work for all of them.
    I haven't done exhaustive research into which parameters work and which don't, but most of the parameters for individual voices within Ultrabeat don't - which is annoying as that is what I was trying to use it for.
    Any ideas about this, or workarounds?

    OK, well an update on this in case anyone's interested.
    With some further experimentation I have discovered that this problem did not exist in Logic 7 - ie you can move current track automation data for individual Ultrabeat voices to the region.
    It's also possible to move automation data for individual Ultrabeat voices using 'Move All Track Automation Data to Region,' so I suppose this is a kind of workaround, though it can be annoying if you don't want to move all track automation data.
    I'm now assuming this is a bug in Logic 8; is there any way to convert a Logic 8 project to work in Logic 7, as this along with the touch tracks bug is making working in Logic 8 very frustrating?

  • Date Field Changed After Persistence

    When persisting an object the date field is changed from it's original
    millisecond value to a new value.
    i.e.
    Before persist fastTime: long = 1065003043301 (java.util.Date)
    After persist fastTime: long = 1065003028240
    (com.solarmetric.kodo.util.ProxyDate)
    It is not consistent. Sometimes it correct, other times it's not.
    So my equal() method fails as the member variable Timestamp is different. I
    need to filter on this value and for it to be 'exactly' the same.
    How?
    Config
    KODO 2.5.3,
    Database MYSQL, Default Table type MYISAM, same on InnoDB
    default .JDO file for persistent object
    defaults in kofo.properties

    Graham-
    Unfortunately, SQLServer is only able to store dates to a 3 millisecond
    precision, which means that if your date's milliseconds part is not
    divisible by 3, then you will get back a different date that you
    entered.
    Two possible solutions:
    1. Subclass the SQL Server dictionary to store all date fields as
    longs. This will require that the date field on the server is also a
    BIGINT.
    2. Manually round the milliseconds part of your date to the nearest 3
    milliseconds.
    In article <ble9lc$dne$[email protected]>, Graham Cruickshanks wrote:
    When persisting an object the date field is changed from it's original
    millisecond value to a new value.
    i.e.
    Before persist fastTime: long = 1065003043301 (java.util.Date)
    After persist fastTime: long = 1065003028240
    (com.solarmetric.kodo.util.ProxyDate)
    It is not consistent. Sometimes it correct, other times it's not.
    So my equal() method fails as the member variable Timestamp is different. I
    need to filter on this value and for it to be 'exactly' the same.
    How?
    Config
    KODO 2.5.3,
    Database MYSQL, Default Table type MYISAM, same on InnoDB
    default .JDO file for persistent object
    defaults in kofo.properties--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Receiveing data over RTP doesn't work

    First of all , excuse my english.....it really sucks
    Second of all , this is my problem:
    I modified the JMStudio source to suit my needs.....leaving just what i needed.The application works......it sends data just fine but it does't receives it.I tried to rewrite the function thousand of times in different modes but it doesn't work.
    This is my source code :
              private void openRtp () {
    OpenRtpDialog dlgOpenRtp;
    String strAction;
    String strAddress;
    String strPort;
    String strTtl;
    RTPManager           receptie=RTPManager.newInstance();
    InetAddress      adresaip=null;
    int                    port,ttl;
    ReceiveStreamListener receptiestr = null;
    ReceiveStreamEvent     x = null;
    dlgOpenRtp = new OpenRtpDialog ( this, cfgJMApps );
         dlgOpenRtp.isVisible ();
    strAction = dlgOpenRtp.getAction ();
    if ( !strAction.equals(JMDialog.ACTION_OPEN) )
    return;
    strAddress = dlgOpenRtp.getAddress();
    strPort = dlgOpenRtp.getPort ();
    strTtl = dlgOpenRtp.getTtl ();
                   try {
                        adresaip=InetAddress.getByName(strAddress);
                   } catch (UnknownHostException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
    port=Integer.valueOf(strPort).intValue();
    ttl=Integer.valueOf(strTtl).intValue();
    SessionAddress adresa=new SessionAddress(adresaip,port,ttl);
         try {
                        receptie.initialize(adresa);
                   } catch (InvalidSessionAddressException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                   } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
    if ( receptie == null ) {
    MessageDialog.createErrorDialog ( this, JMFI18N.getResource("jmstudio.error.sessionmngr.create") );
    return;
    receptie.addReceiveStreamListener(receptiestr);
    receptiestr.update(x);
    update(x);
    // the rest will be done when we get NewReceiveStreamEvent
    updateMenu ();
    pls tell me what i do wrong cause it's driving me insane......the function from the JMStudio works in the original but doesn't work in my version so it makes me think that the problem is from somewhere else.
    For further assistance i'll be watching this thread closely.
    Thank you for your help.
    Yours gratefully,
    Sorin

    I'm just going to point you in the direction of some sample code...
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/AVReceive.html]
    Go look at their "initialize" function and figure out what the sample code is doing that you aren't...
    And remember, it could simply be a matter of doing something wrong with IP address... You can't use 127.0.0.1 for RTP transmissions, and you can't broadcast to the same computer if your transmit code is binding the destination port as the transmission port. IE, if you tell it to broadcast to the remote computer on port 2600, and it uses the local port 2600 to broadcast on...then you won't be able to read from port 2600 on the local computer.

  • Submenu HOVER change doesn't work

    I've tried everything I could think of (for the past 2
    hours).
    The Submenu Text Change Instruction doesn't work for me (PC,
    IE7 and Firefox)
    I've tried to add all kinds of properties to make the SUBMENU
    Item change when the mouse hovers over it. Whatever I do, it always
    shows only on the main menu item (the main menu item that contains
    the submenu).
    In the instructions it says to change this:
    ul.MenuBarHorizontal a.MenuBarItemSubmenuHover
    but it's just not working. SOMEBODY HELP PLEEEZE!!!!!
    THANKS! Very very greatful for any enlightenment at 1:30 in
    the morning. ;)
    (The submenu indication arrow "SpryMenuBarDown.gif" isn't
    showing up in the preview either, btw.... shows in DW but not when
    previewed in browsers. ...but, I guess, that's a separate problem.
    sigh.)

    ok, here is what I've come up with (not fully functional, for
    the color won't show but AT LEAST the underline shows on hover)
    IN THE SPRY STYLE SHEET I've added:
    a.submenulink:hover {
    color: #CC0000;
    text-decoration: underline;
    In the HTML code (directly in the 'a' tag of the submenu
    list) I've added:
    <li><a href="#" target="_self"
    class="MenuBarItemSubmenu">Hot Topics</a>
    <ul>
    <li><a href="#" target="_blank"
    class="submenulink">Water and Sewer</a></li>
    <li><a href="#" target="_blank"
    class="submenulink">Green Buildings</a></li>
    NOTICE that the first link is the MAIN MENU item (not in the
    submenu but the header of the menu, if you will).

  • Transactional Data Field Change

    Hi SDNites,
    I am trying to identify all the field changes (Transactional Data) which has been done into CRM for a specific transaction (Ex: Service request). Could you please suggest any BADI or any function module which will provide me the same.
    Regards,
    Abhi

    Deletion of fields is not possible in ODS, Cube with data till the version 3.5, BI 7 onwards the swapping deletion is possible with the feature Remodeling.
    You can add the fields when datatarget is with data but deletion is not possible.
    WHat you can do is..
    !, Stop the further data loading by disconnecting the map from tranfer strucute level and remove the field from extractor=> considering performance and memory.
    2. create a copy of ods1..to ods2, create export data source from ods1, create update rule, mapping and do the data loading to ods2, Delete th ods 1 data, remove the field and again created export data source from ods 1 to 2 and load the data.

  • Javascript created in fireworks doesn't work with touch ipad and mobile devices.

    My website was created in DreamWeaver.
    Navigation is a popup/dropdown menu run by javascript created in FireWorks
    Website: www.woodstockchamber.com
    Problem:
    The mouse over doesn't work on iPads and mobile devices.
    The menu opens up and the category highlights, but that is where the action stops.
    It doesn't complete the action and link.
    It has worked well for years on desk tops and laptops.
    This is a serious issue for me as iPads and mobile devices are so popular and used a lot in this tourist town.
    Thanks,
    Norm

    http://www.smashingmagazine.com/2010/05/28/web-development-for-the-iphone-and-ipad-getting -started/
    http://www.inspiredm.com/2010/02/09/ipad-design/
    http://blogs.sitepoint.com/2010/06/23/develop-for-ipad-with-html5-trial-and-error/

Maybe you are looking for

  • Does dropping bitmap index and creation of b- index cause any dead locks

    Does dropping a bitmap index on table which is being used continuously for DML operations and creation of b- index cause any dead locks on a table in oracle 10g database ( 10.1.0.4.0 - 64bi). we have seen alert log file which has dead lock occurrence

  • Help with Workflow FCP to Compressor then DVD Pro and Shaky footage

    Hi, I am new to using a MAC and also to Final Cut Studio so if this question has been asked before or seems obvious then I offer my apologies. I have a clip on the timeline which is a little shaky but I need to use it. I have added a SmoothCam filter

  • Several Questions from a Seasoned Itunes User...

    1) Is there a way to delete all my duplicates, but keep songs with the same title from different albums? For example, how do I keep Phish's "Bouncing Around The Room" from Lawn Boy, AND "Bouncing Around The Room" from A Live One, but delete one of th

  • How to change the field size cache/buffer in a query

    I query a field from sql developer, the field is cases_history, it resides in a data mart in the global network of our company. this field is big in size, it stores logs in a sequential way, so field size increases a lot. when i query it and try a "s

  • Dynamic text not displaying when publishing for flash 8

    This dynamic text works fine when the movie is published for flash 7, but when i export for the flash 8 player it seems to be invisible. Is there any obvious reason for this happenning? thanks jon