Perfil de LambertLambert Qin's technical ...FotosBlogListasMás Herramientas Ayuda

Blog


    31 agosto

    Create an survey with pictures and other HTML formats

    One of the limitations of SharePoint is that it only support an simple text format survey which is not enough for many scenarios.

    However, create a full customized ASP.NET survey for SharePoint is not easy, it involves a lot of coding work.

    Here is an general method that help administrartors and power users who have limited coding skill to build a beautiful survey.

    Step 1: create an OOB survey.

    image

    Step 2: Open the survey in SharePoint Designer,upload a picture which would be used later.

    image

    Step 3:Create a HTML page in SharePoint Designer, design your survey. Copy the HTML code.

    image

    Step 4:Paste the HTML into the question (notice: must include the Table tag)

    image

    Preview:

    image

    Step 5:Copy the JavaScript to the form files (newForm,editForm and etc.)

    document.getElementsByTagName('Table').item(0).outerHTML
    =
    document.getElementsByTagName('Table').item(0).outerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');

    Tips: if you do not know where to insert the code, look for the following area which contains an OOB JavaScript code

    image

    Preview:

    image

     

    Comments:

    The functionality of the JavaScript converts the escape character back, so that the pictures and HTML codes display correctly.

     

    Updates [2009-11-02]:

    Thanks for Mike Sharp’s idea here: http://social.technet.microsoft.com/Forums/en-US/sharepointcustomization/thread/8b97bc31-f72d-4104-bd40-d8d72a8f7fbf

    There should be a potential for XSS, and narrow the scope of what gets un-escaped should reduce the risks:

    For DispForm, NewForm and EditForm pages. using
    document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML = document.getElementById('onetIDListForm').rows[0].cells[0].innerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');
    For the Summary page doesn't have the same onetIDListForm cell, using the ID of the web part zone TD cell:
    document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML = document.getElementById('MSOZoneCell_WebPartWPQ2').innerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');

    Comentarios

    Espera...
    El comentario que has escrito es demasiado largo. Acórtalo.
    No has escrito nada. Vuelve a intentarlo.
    No se puede agregar tu comentario en este momento. Vuelve a intentarlo más tarde.
    Para agregar un comentario, necesitas permiso de tus padres. Pedir permiso
    Tus padres han desactivado los comentarios.
    No se puede eliminar tu comentario en este momento. Vuelve a intentarlo más tarde.
    Has superado el número máximo de comentarios que se puede dejar en un día. Vuelve a intentarlo en 24 horas.
    Se ha deshabilitado la capacidad de tu cuenta de dejar comentarios porque nuestros sistemas indican que podrías estar enviando correo no solicitado a otros usuarios. Si crees que tu cuenta se ha deshabilitado por error, ponte en contacto con el servicio de soporte técnico de Windows Live.
    Para terminar de dejar tu comentario, realiza la siguiente comprobación de seguridad.
    Los caracteres que escribas en la comprobación de seguridad deben coincidir con los de la imagen o el audio.

    Para agregar un comentario, inicia sesión con tu cuenta de Windows Live ID (si utilizas Hotmail, Messenger o Xbox LIVE, ya tienes una cuenta de Windows Live ID). Iniciar sesión


    ¿No tienes una cuenta de Windows Live ID? Regístrate

    Vínculos de referencia

    La dirección URL del vínculo de referencia de esta entrada es:
    http://lambertqin.spaces.live.com/blog/cns!E93C48B467E6B3E1!1121.trak
    Weblogs que hacen referencia a esta entrada
    • Ninguno