Comments (14)
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.
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.
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.
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.
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.
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.
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.
I'll get back to you real soon after my testing. Thanks
from sharepointplus.
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.
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.
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.
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?
Thanks again!
from sharepointplus.
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.
Nice, thanks!
from sharepointplus.
Related Issues (20)
- getWorkflowID does not work in NodeJS HOT 6
- stopWorkflow does not work inside NodeJS : ReferenceError: document is not defined HOT 16
- $SP().getUserInfo POST Status 500 error HOT 2
- .get() paging and rowlimit not working for SPO document library HOT 7
- need an example for add.options.packetsize HOT 6
- setReadOnly:Error HOT 3
- Observables with Sharepoint+ HOT 1
- Getting the count of rows from a list HOT 2
- Error from server-side node HOT 4
- addAttachment contextinfo 404 error HOT 19
- Get Column Type HOT 1
- Translate SharePoint column names HOT 2
- distribution list members HOT 2
- Unable to getContentTypeInfo HOT 3
- The site URL passed in the setup object is always ignored in the isMember(...) function HOT 6
- RequestError: Error: tunneling socket could not be established, cause=Client network socket disconnected before secure TLS connection was established HOT 1
- sp.lists gives `ReferenceError: window is not defined` HOT 2
- sharepointplus with sp-rest-proxy HOT 11
- incorrect hasREST function behavior for Sharepoint Online / 365 HOT 2
- joins HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharepointplus.