How to simply add custom property to a HTML Form Web Part?

Hello.
Is it possible to add a custom property (like a date-field) to a HTML Form Web Part with help of JavaScript? I do not want to use Visual Studio / Nappa etc. Is this possible in an easy way?
Thanks for your help.

Hi,
Based on your description, my understanding is that you want to count the date between today and the latest event date.
You can create a calendar in a page firstly, then add a content editor web part rather than the html form web part, as html form web part can't place the Jquery element.
Then you can firstly read the date field value of the calendar list using JavaScript Client Object Model and then calculate the difference between two date values using Jquery. You can add the code directly in the content editor web part.
Here are some detailed code demos for your reference:
Get SharePoint calendar list field value using JavaScript Client Object Model:
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(document).ready(function(){
SP.SOD.executeFunc("sp.js", "SP.ClientContext", retrieveListItemsCal);
function retrieveListItemsCal() {
var clientContextCal = new SP.ClientContext.get_current();
var oListCal = clientContextCal.get_web().get_lists().getByTitle('Calendar');
var camlQueryCal = new SP.CamlQuery.createAllItemsQuery();
AllItemsCal = oListCal.getItems(camlQueryCal);
clientContextCal.load(AllItemsCal);
clientContextCal.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededCal), Function.createDelegate(this, this.onQueryFailedCal));
function onQuerySucceededCal(sender, args) {
var listItemInfo = '';
var listItemEnumeratorCal = AllItemsCal.getEnumerator();
var htmlCal = '';
while(listItemEnumeratorCal.moveNext()) {
var oListItemCal = listItemEnumeratorCal.get_current();
htmlcal= oListItemCal.get_item("Start Time").format("MMMM d, yyyy"));
break;
function onQueryFailedCal(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
</script>
Calculate the difference between two dates:
http://stackoverflow.com/questions/2609513/jquery-calculate-day-difference-in-2-date-textboxes
Thanks
Best Regards
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected].
Jerry Guo
TechNet Community Support

Similar Messages

  • Add custom property restrictions in advanced search web part

    hi,
     I am having the default advanced search box web part in my ent.search center site collec. but as per my requirement i need to a  few items in the property restrictions dropdown in my advanced search web part.
    is this possible in sp 2013 e.t serach center  site collection?
    any help is  highly appreciated!

    Hi,
    Check this
    http://technet.microsoft.com/en-us/library/ff621097.aspx
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c25d418d-d4a2-47a3-9abe-c27656764843/how-to-add-custom-property-in-advanced-search-page?forum=sharepointgeneralprevious

  • How to create Image as Custom Property Type used in Configurable Web Part?

    I wanted to create custom configurable web part property for Image.
    Example - the screenshot of Image property used in Image web part is shown below:
    My goal is to create as many images as possible in custom configurable web part.
    I tried to write the code:
    [WebBrowsable(true),
    WebDisplayName("Example Photo"),
    WebDescription("Example Photo of the user"),
    Category("Custom User Profile"),
    Personalizable(PersonalizationScope.Shared)]
    public Image ExampleUserPhoto { get; set; }
    However, the result does not display Image configurable web part property.
    I wonder why the data type Image does not cause the custom web part to have Image configurable web part property.
    Other data types such as Boolean, Enum, Integer, String and DateTime can be used.
    How can I create Image as Custom Property Type used in Configurable Web Part?

    I have examined that context node __00 has been enhanced,and  has a class name  z___00. But  when I created a new attirubute by right click " Attributes" with wizard under context node __00.There is still  a error message "view is not enhaced or copied with wizard".
    But  when  I created a method  "getvaliation "  in the class of context node zcl__00, the attribute  'valiation' automatically created(at the same time the method "getvaliation' automatically  created for the attribute 'valiation') and I need not to create attibute 'validation' by wizard .  It seemed as if the problem is resloved. But when I make test for it in web ui .There is a runtime erro message.
    Do I need to make some configurations in  the business object layer  for the checkbox? but  the checkbox is only used as a flag  to decide whether a backgoud job is needed to be executed.
    Edited by: samhuman on Jun 22, 2010 10:31 AM

  • How can i add custom attributes to a new Class Object using the API ?

    Hello everyone,
    Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
    // doc is an instance of Document
    ClassObject co = doc.getClassObject();
    ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
    cod.setSuperclass(co);
    cod.setSuperclassName(co.getName());
    cod.setName("MYDocument");
    ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
    Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
    AttributeDefinition value = new AttributeDefinition(ifsSession);
    value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
    c.addAttribute(value);
    But i got the following error message :
    oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
    java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
    oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
    void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
    So, what am i doing wrong ?
    More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
    Any help would be appreciated. Thanks in advance.
    Guillaume
    PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
    null

    Hi Guillaume,
    you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
    is used to check for erronous cases only
    and it shouldn't be used otherwise.
    Creating your own objects could be simply done via
    ClassObject ifsClassObject;
    DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
    // get class object for my very own document
    ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
    // set the class for the document i'd like to create
    ifsDocDef.setClassObject(ifsClassObject);
    // set attributes and content for the document...
    ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
    ifsDocDef.setContent("This is the content of my document");
    // create the document...
    PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
    null

  • How we can add custom field in standard report 2kee.

    Hi,
    How we can add custom field in standard report 2kee.
    I need one extra field to add in 2kee report for the same is there any customization req.
    Regards
    Ravi

    Ravi,
    Which extra field do you want to add or see?  Without specifying the field, it is difficult for one to tell you precisely whether you need a custom field or just change the layout to get the standard one.
    There are so many fields which exists but are not displayed when you execute 2KEE. You need to change the layout selections to your preference.
    Nonetheless, if the field you want to add does not already exist, then yes you can do customization.  Is there a customization requirement? No. But remember, you are making changes to SAP Standard program which will no longer be supported by SAP should in the case an issue arise in the future related to this very program.
    Have your abaper add the said field in the program or why not just create a query to pull the report?
    Elias
    Edited by: Elias Akorli on Sep 18, 2009 9:02 PM

  • How can i add Custom fields into the

    Dear Experts
    We have Ecc6.0 system,
    How can i add Custom fields into the Infotype Screen(PA30),i heard that we do it by PM01 Tcode.
    But in PM01 i am unable to find the enhance infotype tab.
    How can i do it ....pls help.....
    Regards
    Sajid

    Hi,
    Do it thru the third tab : Single Screen.
    There write down the infotype number (e.g. 0022) and say generate objects.
    Regards,
    Dilek

  • How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM.

    How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM. I found that it can be
    done by using XsltListViewWebPart class but how can I use this one by using shraepoint client api.
    shiv

    Nice, can you point me to the solution please ?
    I'm  trying to do this but I get an error : 
    Web Part Error: Cannot complete this action. Please try again. Correlation ID: blablabla
    StackTrace:    at Microsoft.SharePoint.SPViewCollection.EnsureViewSchema(Boolean fullBlownSchema, Boolean bNeedInitallViews)     at Microsoft.SharePoint.SPList.GetView(Guid viewGuid)   
    All help really appreciated.

  • How do you add minimal numbers in a loan form?

    How do you add minimal numbers in a loan form as in: http://screencast.com/t/KcE65bHCG?

    Hi Andy,
    You can define the amount in the webform field. You need to make changes in the HTML of the form as mentioned in this article : http://kb.worldsecuresystems.com/kb/collect-payment-using-form.html#modify-amount
    Hope this helps.
    Cheers,
    Aishvarya Raj Rastogi

  • How can I add a turning number to a Flash web form?

    How can I add a turning number to a Flash web form?

    what's a "turning number"?

  • How to display user-editable title in control template (search web part)

    Hi all,
    SharePoint 2013. I've created a custom control template for a search box.  In the settings there is an option to display the chrome, which will display the Title above the web part as entered by the user in the settings for that web part.  
    However, I want to change where this title appears (without the chrome being visible) inside a specific div in my web part HTML - can I manually add a tag (similar to  _#= Title =#_ for example) that will render the title for me?  Or is there som
    js code that will allow me to get that title?
    Thanks in advance!

    Hi,
    According to your post, my understanding is that you want to change the position of the title of the search box.
    You can add the code below to Content Editor Web Part.
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script><script type="text/javascript">
    $(function(){
    $("h2[class='ms-webpart-titleText']").css("margin-left","90px");
    </script>
    If you want to hidden the Content Editor Web Part, you need to edit the web part to change the setting:
    The result is as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to add custom property to CharacterFormat?

    Hi,
    Is there a way to add the custom property to character format and save in to XML TextFlow without significant changes in TLF?

    Interesting.  Looks like that could maybe be an ASDoc bug or something else going on.  The actual implementation of the contructor for ApplyElementUserStyleOperation in my build of TLF looks like this:
    public function ApplyElementUserStyleOperation(operationState:SelectionState, targetElement:FlowElement, styleName:String, value:*, relativeStart:int = 0, relativeEnd:int = -1)
    I'm not sure how to answer #2, but my first thought is that there's a fairly good chance that whatever you end up using 'user styles' for will not be related to the actual formatting of the text.  It could be some sort of metadata that's completely abstract from how the text is formatted or represented visually, which is where the text layout format applies.  There are more technical reasons why it shouldn't be there also, but they're probably not worth the energy unless you really want to know.   ..and Robin would be a better person to comment on that also.
    I don't know what build of TLF (if any) is included in the Flex 3.4 SDK, but TLF does not have any dependencies on the Flex framework (or any particular version of it).  The only requirement is that you are targetting Flash Player 10 or above.  You can always download the latest (or a very recent) version of the TLF SWC's, RSL's, and source with the Flex 4 SDK from the Flex 4 download site at:
    http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4

  • How do I map custom property from portal api ptsearchresponse?

    I want to map the search results to my datatable.
    I can execute the search fine. But how do I map the property value? My property id is 101.
    In other words which ptSearchResponse method do I use?
                    IPTSession ptSession;
                    IPTSearchRequest ptSearchRequest;
                    IPTSearchResponse ptSearchResponse;
                    IPTSearchQuery ptSearchQuery;
                    string serverConfigDir = ConfigPathResolver.GetOpenConfigPath();
                    IOKContext configContext = OKConfigFactory.createInstance(serverConfigDir, "portal");
                    PortalObjectsFactory.Init(configContext);
                    ptSession = PortalObjectsFactory.CreateSession();
                    ptSession.Connect(1, "", null);
                    // Create a SearchRequest object
                    ptSearchRequest = ptSession.GetSearchRequest();
                    // Set search settings (constraints)
                    // Set maximum results desired (100)
                    ptSearchRequest.SetSettings(
                    PT_SEARCH_SETTING.PT_SEARCHSETTING_MAXRESULTS, 100);
                    // Set the folder in which to search (array to support multiple folders)
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_DDFOLDERS,
                        new int[] { Convert.ToInt32(ConfigurationManager.AppSettings["DocumentFolderId"]) });
                    // Include subfolders of the folder
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_INCLUDE_SUBFOLDERS, true);
                    // Restrict search to just portal documents
                    // (not ALI Collaboration or ALI Publisher)
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_APPS, PT_SEARCH_APPS.PT_SEARCH_APPS_PORTAL);
                    // get documents only
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_OBJTYPES, new int[] { PT_CLASSIDS.PT_CATALOGCARD_ID });
                    // Request the intrinsic PT_PROPERTY_PROVIDERCLSID and custom property 101
                    ptSearchRequest.SetSettings(
                        PT_SEARCH_SETTING.PT_SEARCHSETTING_RET_PROPS,
                        new int[] { PT_INTRINSICS.PT_PROPERTY_PROVIDERCLSID, 101 });
                    //Use IPTFilter to create search filter with clause with two statements
                    IPTFilter ptFilter;
                    IPTPropertyFilterClauses ptFilterClause;
                    IPTPropertyFilterStatement ptFilterStmt1;
                    IPTPropertyFilterStatement ptFilterStmt2;
                    // Create the filter itself
                    ptFilter = PortalObjectsFactory.CreateSearchFilter();
                    // Create the filter clause
                    ptFilterClause = (IPTPropertyFilterClauses)ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_CLAUSES);
                    ptFilterClause.SetOperator(PT_BOOLOPS.PT_BOOLOP_OR);
                    // Attach it to the filter itself
                    ptFilter.SetPropertyFilter(ptFilterClause);
                    // Put two statements into the clause
                    ptFilterStmt1 = (IPTPropertyFilterStatement)
                        ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_STATEMENT);
                    ptFilterStmt1.SetOperand(101);
                    ptFilterStmt1.SetOperator(PT_FILTEROPS.PT_FILTEROP_CONTAINS);
                    ptFilterStmt1.SetValue(tbSearch.Text.Trim());
                    ptFilterClause.AddItem(ptFilterStmt1, ptFilterClause.GetCount());
                    ptFilterStmt2 = (IPTPropertyFilterStatement)
                        ptFilter.GetNewFilterItem(PT_FILTER_ITEM_TYPES.PT_FILTER_ITEM_STATEMENT);
                    ptFilterStmt2.SetOperand(1);
                    ptFilterStmt2.SetOperator(PT_FILTEROPS.PT_FILTEROP_CONTAINS);
                    ptFilterStmt2.SetValue(tbSearch.Text.Trim());
                    ptFilterClause.AddItem(ptFilterStmt2, ptFilterClause.GetCount());
                    // Make the filter into an actual search query
                    ptSearchQuery = ptSearchRequest.CreateAdvancedQuery(ptFilter);
                    // Run the search and return results
                    ptSearchResponse = ptSearchRequest.Search(ptSearchQuery);               
                    // How many things matched the search?
                    int totalMatches = ptSearchResponse.GetTotalMatches();
                    // How many items were returned? (Not necessarily all)
                    int returnedMatches = ptSearchResponse.GetResultsReturned();
                    // create DataTable and map results to
                    // datatable fields
                    DataTable dtSearchResults = new DataTable("Documents");
                    dtSearchResults.Columns.Add("Name");
                    dtSearchResults.Columns.Add("Excerpt");
                    dtSearchResults.Columns.Add("DocSubject");
                    dtSearchResults.Columns.Add("DocTopic");
                    dtSearchResults.Columns.Add("DocType");
                    dtSearchResults.Columns.Add("DocKeywords");
                    dtSearchResults.Columns.Add("Url");
                    dtSearchResults.Columns.Add("ImageURL");
                    DataRow dr;                                                                                                          
                    // Print the name of each result
                    for (int i = 0; i < returnedMatches; i++)
                        dr = dtSearchResults.NewRow();
                        String strName = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTNAME);                  
                        String strText = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTSUMMARY);
                        String strURL = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_DOCUMENTURL);
                        String strImageURL = ptSearchResponse.GetFieldsAsString(i, PT_INTRINSICS.PT_PROPERTY_OBJECTIMAGEUUID);
                        dr["Name"] = strName;
                        dr["Excerpt"] = strText;
                        dr["Url"] = strURL;
                        dr["ImageURL"] = "pt://images/plumtree/portal/public/img/sml" + strImageURL + ".gif";
                        dtSearchResults.Rows.Add(dr);
    Edited by [email protected] at 04/11/2008 7:26 PM
    Edited by [email protected] at 04/11/2008 7:27 PM

    Problem solved. I should use JsonObject instead of JSONObject :D 

  • How to define a custome property in User Profile to Save Roles Sort priority ?

    Hi All,
    I have a requirement where in, user should get an option to decide his default tab(role), when he logs into portal.
    e.g.: If user1 and User2 is assigned with 2 roles namely Leave & Travel. User1 should be able to select Leave as his default tab and User2 should be able to select Travel as his default tab.
    I was thinking if I can store what use selects in a custom property and change the tabs through custom application.
    Please let me know how can achieve this in CE 7.3 portal.
    Thanks in Advance,
    Pavan.

    Hi Pavan,
    If you are using the AJAX framework page the user can simply drag the tabs and it will automatically be saved in the personalization.
    user should:
    1. place mouse over the role (in the top left corner you will see a triangle).
    2. place mouse over triangle and, push and hold down mouse button.
    3. drag the mouse to the navigation place where you want it to be (notice black line).
    4. leave the mouse button.
    Now the order of the tabs are saved in the personalization for that user only.
    Hope this is what you meant.
    BR,
    Saar

  • How can I add customer's information?

    I can add user to the wlcs_user table with jsp now .
    <um:createuser.............>
    But
    1. How can I add user to customer with jsp?
    2. How can I add user's information eg:cardid,e_mail,address etc) with jsp?
    which table these information will put into ?
    Thank in advance.

    I can add user to the wlcs_user table with jsp now .
    <um:createuser.............>
    But
    1. How can I add user to customer with jsp?For WLCS 2.0.1, look at the example code that came with the MyBuyBeans demo in
    <wlcs-install-dir>/src/examples/buybeans/client
    In particular, look at UserInformation, which is used to collect information
    for your Customer and look at RegistrationHelper, which has a
    register(userInformation) method that is used to create a new Customer.
    For WLCS 3.1 the Customer extends User, so that the Unified User Profile (see
    the documentation) can be used to easily integrate customers with WLPS users.
    2. How can I add user's information eg:cardid,e_mail,address etc) with jsp?
    which table these information will put into ?Look at _userreg.jsp.  These are properties that have not been registered with
    the "exampleportal" property set using the administration tool, so you cannot
    set them with the administration tool. You must use JSP tags or the API to set
    them.
    Ture Hoefner
    BEA Systems, Inc.
    2590 Pearl St.
    Suite 110
    Boulder, CO 80302
    www.bea.com

  • How can i add custom document properties in Content Services?

    Hello guys.
    I have question. I need to add custom attributes of document uploaded in CS.
    I know about categories, and it will help me.
    But i need it on the properties page? in main tab, where docname, creationdate, etc. appears. Is it possible?
    Ideally it should appears in main window of CS, without any additional clicks.
    Is there any way organize it without development new Web Services?
    Thank you.

    One possible way of doing this would be to use the $A mapping in the send_access mapping table. see http://docs.iplanet.com/docs/manuals/messaging/ims52/ag/filter.htm#15965
    This will depend on what value you wish to use in the header and when and where during the message routing you want to add the header.
    You can use channel level filters on the send_access or orig_send_access mapping table to control at which point the header is added but without knowing more about what you wish to do and which conditions you wish to use to add the header it is difficult to say more. It is possible to use a "customer supplied routine (in the form of a shared object call) from the mapping process, but during the mapping process the only information available to the routine is the sender and recipient info so that probably isnt suitable for your purposes.
    Another method of header manipulation in IMS is channel header option files but these should be used with caution and will only operate on "known" headers and as a result are probably not of too much use to you either.
    The conversion channel does have access to the original message headers http://docs.iplanet.com/docs/manuals/messaging/ims52/rm/mta_conf.htm#1044412
    but Im afraid I cant point you at an example of where it has been used like this - perhaps someone else can.
    WRT moving the message to the top of the message list - I presume this is from the clients perspective - How did you accomplish this in NMS as message views and sorting are almost exclusively a client responsibility ?
    Also have you looked at the ENS service available with IMS?
    Sorry I cant offer anything more than that but without knowing what functions your previous SMTP plugin performed its a bit difficult.
    Ciaran

Maybe you are looking for

  • Yahoo mail - can't open eail from inbox, java is running, 2 diff browsers, 2 diff computers

    this has been going for a long time -- cannot open an email from my inbox -- it hangs and hangs -- tried cntr-click to open in a new tab -- same hanging. various results when it stops attempting: error code 7 -- or totally blank screen -- or "were wo

  • Acrobat cannot open files in the "Adobe PDF document" format

    The document "example.pdf" could not be opened. Acrobat cannot open files in the "Adobe PDF document" format. Hi All, Running Acrobat Pro 9.4.2 on Snow Leopard, have never had this problem before. Showed up about a week ago, I believe with new update

  • SAP XI UPgrade to 7.0

    Hi, We are going to upgrade SAP XI to 7.0 for a client. I wanted to know what all things needs to be taken care of and any other information/questions which needs to be asked from current vendor/client. Please help. Thanks. Message was edited by:    

  • Linking two class files?

    hello! I have a class called paul.java and a class called trialgrid.java... paul.java is a menu screen that simply has four buttons, one of the buttons is called btnOnePlayer, trialgrid.java is a battleships game that is one player! my question is ho

  • Fade Radial Blur

    Is there a 'fade radal blur' in CS3? I'm going thu a tutorial and it says to go to edit>fade radial blur. Has something replaced this? TIA