How to get inputted value in a RTE field on custom page and submit by REST call in 'Sharepoint hosted app'.

Hi I am facing the three questions below.
1. How to use default RTE in custom page in Sharepoint hosted app.
 I saw the article of Rich text Editor (ribbon based) in a webpart in SharePoint 2013 and tried it. But it did not work well. I guess it needs code-behind setting, however sharepoint hosted app does not support code-behind.
Does anybody know how to do this?
2. In above case, I placed the below code on custom page and tried to get the field's value when submit button was clicked.
<SharePoint:InputFormTextBox ID="rftDefaultValue"
RichText="true"
RichTextMode="FullHtml" runat="server"
TextMode="MultiLine" Rows="5">
</SharePoint:InputFormTextBox>
In debugger, the returned value was 'undefined'.
var note = $('#hogehoge').val();
Is it possible to get the RTE value? If yes, please let me know how to do this.
3. I need to submit the RTE value using REST call.
In this
article in MSDN, the item creation sample treats single line text field. Does anybody know the sample for RTE?

Hi,
According to your description, you might want to use Rich Text Editor control in your SharePoint hosted app.
First of all, I would suggest you post one question in one thread to make it easier to be discussed, which would also help you get a quick solution.
Though we can add this control into a SharePoint hosted app, however, as we can’t add code behind for it, plus with the potential compatibility issues in different
browsers, I would suggest you use other JavaScript Rich Text Editor plugins instead.
Two JavaScript Rich Text Editor plugins for your reference:
http://quilljs.com/
http://nicedit.com/
If you want to submit the value of Rich Text Editor control to a SharePoint list using REST call, since the content in the Multiple Line of Text column is wrapped
with nested HTML tags, the similar requirement would also be applied to the content to be submitted.
Here is a code snippet about how to update a Multiple Line of Text column for your reference:
updateListItem(_spPageContextInfo.webAbsoluteUrl, "List018", 1);
function updateListItem(siteUrl, listName, itemId)
var itemType = GetItemTypeForListName(listName);
var item = {
"__metadata": { "type": itemType },
"MultiTextEnhanced": "<div><a href='http://bing.com/'>Bing</a><br></p></div>",
"Title": "123"
$.ajax({
url: siteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
console.log(data);
$.ajax({
url: data.d.__metadata.uri,
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify(item),
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "MERGE",
"If-Match": data.d.__metadata.etag
success: function (data) {
console.log(data);
error: function (data) {
console.log(data);
error: function (data) {
console.log(data);
// Getting the item type for the list
function GetItemTypeForListName(name)
return"SP.Data." + name.charAt(0).toUpperCase() + name.slice(1) + "ListItem";
Thanks
Patrick Liang
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]
Patrick Liang
TechNet Community Support

Similar Messages

  • How to get the value for the LIT_Withheld field in the city tax form?

    I am trying to get the value for the LIT_Withheld field on the city tax form , PAYUSEET.. This is not a database column but is generated based on some conditions.. Appreciate the help. Thanks, Suguna

    Hi Abhmanyu,
    Thanks for your response.
    Search Help Name : ZZ_MG_MARITAL_VH
    Selection Method  : T502T
    Search help parameters are SPRSL, FAMST, FTEXT,
    Can u provide me a sample code to fetch the value of corresponding text.
    Thanks,
    Hari

  • How to get input value from a HTML form?

    Hi,
    I use URL class to connect to a simple HTML file. In the returned page there is a form with hidden input with default value. How can I get the values?
    Thanx.

    By parsing the HTML.

  • How to get the value from the readonly field?????

    Hi All,
    I have a readonly field in JSF. in action class i want to get the value of that field.
    How to get the readonly field value???
    i am getting null if the field is readonly.
    i am getting value if the field is not readonly.

    I might have a problem similar to yours. Refer to the post I made entitled "Readonly and Disabled Fields Losing State Between Submits".

  • How to get the value of a parameter/field in a ADF Read-Only Form

    Hi,
    My requirement is as follows. Could anyone shed some light on this issue.
    I am showing the records from db table using ADF Read-Only Form ( which uses ViewObject created for the table). Now I want to capture(get) the value of a field in this form and then have to invoke an action based on the value in this field. I mean to say the next page depends the value of a field in this form.
    Please suggest how can I achieve this functionality?
    Thanks in advance.
    ~Sivaji

    That's indeed what Sivaji needs.
    In the page definition you can add a value to the parameters of a certain method. Like RJundi mentioned, point to the attribute of the current row.
    Example:
    The value of the read only textfield will be something like this:
    #{bindings.EmployeeName.inputValue}points to an attribute value in the pageDef of the page:
        <attributeValues id="EmployeeName" IterBinding="AllEmployees">
          <AttrNames>
            <Item Value="EmployeeName"/>
          </AttrNames>
        </attributeValues>The attribute value has also an iterator binding defined in the page def:
        <iterator id="AllEmployees" RangeSize="10"
                  Binds="AllEmployees" DataControl="MyService"/>If you want to 'pass' the attribute of the current row to the service, you can create a methodaction (eg: public void printEmpName(String name)) in the page def or you can drop the method from the datacontrol on to the page. After dropping the method, a screen will appear asking to fill in a value for the parameter ('name' in this example). Fill in '#{bindings.EmployeeName.inputValue}' if you want to pass the EmployeeName of the current row.
    Hope it helps,
    Koen Verhulst

  • How to get sequence value on click of button in OAF Page

    Hi all,
    I have a requirement to get a field called Bankrefernece number populated with sequence value on click of apply button ; i mean inserting new record in database for new transaction.
    Sequence Value should be something like this:
    Example
    No     Transfer Date     Bank Reference Number
    (DDMMYY_999)
    1     24-Oct-2010     241010_001
    2     24-Oct-2010     241010_002
    3     25-Oct-2010     251010_001
    means every day sequence should start with the date initials.
    Kindly give your valuable input.
    Thanks
    Sims
    Edited by: sims on Jan 4, 2011 11:22 PM

    sims wrote:
    Hi Anil,
    Its a standard page & i want it on click of apply button but my question is when i click apply button it navigates to other page..is it possible in such scenario to extend the controller.
    Thnx for ur suggestion
    SimsThat is not an issue, you can extend the controller of that page and get the value of sequence and set it to the VO attribute.
    Thanks
    --Anil
    http://oracleanil.blogspot.com

  • BDC-How to get the value of the screen field

    Hi All,
    I am facing a problem while writing the BDC code for the XK02 transaction.
    Recording:
    We have recorded like this :after giving the values in the initial screen(vendor no and purchase group and selecting the purchasing data check box) and enter into the second screen and then click on alternative data icon.There we ll have set of plants we have to check auto ordering (by selecting the plant and click purchasing icon)for the plants which are in the given file.
    Problem:
    Suppose there are five plants(like 1,2,3,4,5) for a particular vendor but we are having only three plants in the file for which auto ordering check has to be done.The problem is that its doing auto ordering check for the first three plants(1,2,3) in the transaction.But  in the file we are having Plants like (1,3,5).How to get the screen field value directly or is there any other way to resolve the problem?

    Dear Raja,
    You cannot get hold of screen values while running through the BDC Operation.
    Only way you can get the value --> populating an Internal Table from the Database Table.
    Regards,
    Abir
    Don't forget to award Points *

  • How to get a Value of a JSP field/Attribute?

    Hi im trying to get a value of a field from the EditCurrentRecord databeans. Im trying get the Value of the Attribute "Mdepempno", which will be used as a search field in the next customized webBean.
    Any suggestion? Thanks
    Muraly
    -- here is a portion of the code----
    RowEditor.useEditField("Mdepempno");
    RowEditor.getFieldRenderer("Mdepempno").setPromptText("Dept Manager");
    empnumber = RowEditor.getFieldRenderer("Mdepempno").toString();
    null

    Hi I managed to find the solution, by refering to the earlier replies..
    adding the following codes in teh .jsp page solve the problem.
    <%
    Row row = rsn.getRowSet().getCurrentRow();
    %>
    <% String empnumber = row.getAttribute("Mdepempno").toString(); %>
    Thanks for reading.
    regards
    muraly
    null

  • How to get input values till pressing enter key

    hi!!!
    i need to enter values thru keyboard using bufer reader etc etc
    but i need to stop entering when i press enter key
    how to do this??

    First off I would take a look at this link because it gives quite a few good examples if you've never used scanner.
    You can find all this on the link.-> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
    in order to use scanner you have to import it.
    import java.util.Scanner;then inside your main method you need to create a scanner wrapped around the keyboard inputstream.
    Scanner userIn = new Scanner(System.in);take a look at the api to decide which method you want. For this I would suggest nextLine().
    also I would specify that you want the numbers separated by spaces or comma's or something so you can use the String.split(" "); method which returns an array of Strings;
    then traverse through the array of strings and convert them to ints
    http://www.rgagnon.com/javadetails/java-0004.html

  • How to get Numric value from a Char field in the database?

    I have the following values in a column in Database.
    COMP
    GRADE
    CANC
    CANCELLED
    Comp
    Complete
    INCOMP
    NC
    NS
    85%
    79
    88 .... etc....
    I have to take the value from this field if it is a Numeric other wise I have to ignore that value.
    Please let me know how to handle this?
    Thanks,
    Lakshmi

    Thanks for the inputs.
    Here I want to take the value if it is numeric else I
    will ignore that record.
    Please let me know how to validate the data for a
    Numeric value.
    I don't want to stop my program by throwing these
    exceptions.The sample code catches the exception. At that point you can do whatever you want (set a boolean to say the value is not a number, etc.) - the program does not stop.

  • How to get the value of a specific field in JTable

    hi every one,,,
    i'm intersting to get a field of JTable
    how can i decide the row and the column of JTable???
    and in which type will be the field ??

    If you need the row number of a selected row
    table.getSelectedRow() should work.
    If you are using a mouse then
    Point p = MouseEvent.getPoint();
    int row = table.getRowAtPoint(p);
    int column = table.getColumnAtPoint(p);
    You can set the type of the field in
    TableModel.getColumnClass(int column) method.

  • How to get textfield values from a tableRowGroup

    I have textfield in a table.
    my problem is
    How to get textfield values from a tablerowgroup1.

    I have created getQuantity and setQuantity properties in my session bean and mapped text property of tabletextbox to session bean quantity.
    also used map to set and reatrieve quantity values.
    I am getting error for bean type quantity.

  • How to get the values inputted by the user in Classification view of  MM02

    Hello,
    Does anyone know how to get the inputted values in Classification view of MM02/MM01? I tried to use CLAF_CLASSIFICATION_OF_OBJECTS but this gets the values that is currently saved in the tables and not the values that the user recently inputted in the screen.
    Regards,
    Alfred

    hi
    try this...
    How to Display the Batch Characteristics in BOM?

  • How to get Input-Ready Cell  Value of Input Ready Query?

    Hi,
    How to get input ready cell value in fox formula?
    for example :
    In Input-Ready Query,
    C_Code Month        Psale(input ready)
    1000          05.2012       800
    now i want Psale 800 in fox formua before value save in cube,
    is it possible?
    Thanks
    Ravi

    Hi,
    as I understand your requirement: you want to execute a planning function before 'save'. This possible, cf. note 1356805
    for more details.
    Regards,
    Gregor

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

Maybe you are looking for