GithubHelp home page GithubHelp logo

Starting with SPPlus about sharepointplus HOT 14 CLOSED

aymkdn avatar aymkdn commented on June 12, 2024
Starting with SPPlus

from sharepointplus.

Comments (14)

Aymkdn avatar Aymkdn commented on June 12, 2024

So I confirm that you use the right command : $SP().formfields("Work Pack")

I don't know how much your form is customized, but the HTML code of the default Sharepoint form should look like that:

<table width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 8px;" class="ms-formtable">
  <tr>
    <td width="190px" valign="top" nowrap="true" class="ms-formlabel">
      <h3 class="ms-standardheader">
        <nobr>Work Pack</nobr><span title="This is a required field." class="ms-formvalidation"> *</span>
      </h3>
    </td>
    <td valign="top" class="ms-formbody">
    <!-- FieldName="Work Pack"
       FieldInternalName="Work_x0020_Pack"
       FieldType="SPFieldText"
      -->
      <span dir="none">
        <input type="text" class="ms-long ms-spellcheck-true" title="Work Pack" id="ctl00_m_g_5c0307bf_c2b3_4ab6_adcd_561b63452eda_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" maxlength="50" name="ctl00$m$g_5c0307bf_c2b3_4ab6_adcd_561b63452eda$ctl00$ctl05$ctl00$ctl00$ctl00$ctl04$ctl00$ctl00$TextField"><br>
      </span>
    </td>
  </tr>
[...]
</table>

How looks like your HTML code for this form?!

from sharepointplus.

 avatar commented on June 12, 2024

Some what close. The form applies the tag SharePoint FormField/FormDescription. Here is the excerpt

<table border="0" cellspacing="0" width="100%">
                    <tr>
                        <td width="190px" valign="top" class="ms-formlabel">
                            <H3 class="ms-standardheader">
                                <nobr>Work Pack<span class="ms-formvalidation"> *</span></nobr>
                            </H3>
                        </td>
                        <td width="400px" valign="top" class="ms-formbody">
                            <SharePoint:FormField runat="server" id="ff2{$Pos}" ControlMode="New" FieldName="Work_x0020_Pack" __designer:bind="{ddwrt:DataBind('i',concat('ff2',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Work_x0020_Pack')}" />
                            <SharePoint:FieldDescription runat="server" id="ff2description{$Pos}" FieldName="Work_x0020_Pack" ControlMode="New"/>
                        </td>
                    </tr>
[......]
</table>

from sharepointplus.

Aymkdn avatar Aymkdn commented on June 12, 2024

That is the code from the server. It's better to provide the client
side code, so the code that is seen by the user. Look at the source of the
form in your web browser.
But if you have this kind of code on the server side, then it means it's
not a regular Sharepoint form but a customized one so SharepointPlus is not
for you. In that case you have to use another way.

Le vendredi 8 novembre 2013, marcwenger a écrit :

Some what close. The form applies the tag SharePoint
FormField/FormDescription. Here is the excerpt

[......]

Work Pack *


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-28101901
.

Aymeric

from sharepointplus.

Aymkdn avatar Aymkdn commented on June 12, 2024

Oh I just realize something.... You call the JavaScript before the
form.... So the JS is not able to find the fields because the form doesn't
exist yet ! So two options : move your code after the form, or use
jQuery.ready(document)

Le vendredi 8 novembre 2013, marcwenger a écrit :

Some what close. The form applies the tag SharePoint
FormField/FormDescription. Here is the excerpt

[......]

Work Pack *


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-28101901
.

Aymeric

from sharepointplus.

 avatar commented on June 12, 2024

I have this as the client side code - is this the type of code SPPlus was meant for? I also moved the content editor part containing the javascript below the form. Unfortunately I still get an undefined exception.
regards,
-m

<table border="0" cellspacing="0" width="100%"><tr><td width="190px" valign="top" class="ms-formlabel">
    <H3 class="ms-standardheader"><nobr>Work Pack<span class="ms-formvalidation"> *</span></nobr></H3></td>
    <td width="400px" valign="top" class="ms-formbody"><span dir="none">
        <input name="ctl00$m$g_08f8fecd_350e_4d1c_b2ba_27623780a845$ff2_1$ctl00$ctl00$TextField" type="text" maxlength="8" id="ctl00_m_g_08f8fecd_350e_4d1c_b2ba_27623780a845_ff2_1_ctl00_ctl00_TextField" title="Work Pack" class="ms-long ms-spellcheck-true" /><br />
    </span></td></tr>
    .....

from sharepointplus.

Aymkdn avatar Aymkdn commented on June 12, 2024

I'm sure you're doing something wrong but with no access to your page is
difficult to say what. The html code for the form is good and the way you
call the api also. So if SharepointPlus is called after that the form has
been built then no reason that doesn't work.

An alternative is to use jQuery('input[title="Work Pack"]') that week work
with simple fields.
Le 11 nov. 2013 05:21, "marcwenger" [email protected] a écrit :

I have this as the client side code - is this the type of code SPPlus was
meant for? I also moved the content editor part containing the javascript
below the form. Unfortunately I still get an undefined exception.
regards,
-m

.....


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-28173368
.

Work Pack *


from sharepointplus.

Aymkdn avatar Aymkdn commented on June 12, 2024

Otherwise you can paste the full HTML code of your page and I'll have a better idea of what you're doing wrong!

from sharepointplus.

 avatar commented on June 12, 2024

I'll get back to you real soon after my testing. Thanks

from sharepointplus.

 avatar commented on June 12, 2024

The " jQuery('input[title="Work Pack"]') " works, and I can input values that way. I'll upload my client-side code shortly - can I upload a text file?

from sharepointplus.

 avatar commented on June 12, 2024

It's longer than 65k characters, so here's a link to get the client side html: http://marcwenger.ca/everyone/sharepoint-src.txt

from sharepointplus.

Aymkdn avatar Aymkdn commented on June 12, 2024

OK so when I look at the console error I got :
$SP().formfields("Work Pack") Error: Error: unable to find the table.ms-formtable!

Your form should have the ms-formtable class... I think it's by default on all Sharepoint forms, isn't it?
The script uses the class name to locate the correct table.

from sharepointplus.

 avatar commented on June 12, 2024

Almost there - and thank you! Yes, I added ms-formtable and the script appears to start working... in Firefox, but not IE. SharePoint, being a Microsoft product, would need to work in IE (right?)

This is the exception in IE. I read that this method isn't recognized in IE. Is the script compatible in IE? Or do I have to make a work-around?

untitled

Thanks again!

from sharepointplus.

Aymkdn avatar Aymkdn commented on June 12, 2024

Of course SharepointPlus is compatible with IE and all other browsers. Because your form is customized, it creates a weird error in IE only. I've just updated the current version (3.0.6) to fix this problem for your case.

So download again Sharepoint 3.0.6

from sharepointplus.

 avatar commented on June 12, 2024

Nice, thanks!

from sharepointplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.