Link with variable
Hello,
My first question:
How can I build me a link or button that contains a variable or a field. This field is an ID from another list.
With this link it does not work:
<a href="http://URL/DispForm.aspx?ID=' + fd.field('ID').control()._el().text() + '&RootFolder=*'"> Name </ a>
fd.field ('ID') <- field on the current form.
For ID I want to read the ID of a field.
My first question:
How can I build me on any field a link? For example:
Name: John Doe
-> John Doe should be a link
Thanks!
My first question:
How can I build me a link or button that contains a variable or a field. This field is an ID from another list.
With this link it does not work:
<a href="http://URL/DispForm.aspx?ID=' + fd.field('ID').control()._el().text() + '&RootFolder=*'"> Name </ a>
fd.field ('ID') <- field on the current form.
For ID I want to read the ID of a field.
My first question:
How can I build me on any field a link? For example:
Name: John Doe
-> John Doe should be a link
Thanks!
Hello,
First of all, be sure to check this page to see how to retrieve values off from various form fields: Note, that the field must be present on the actual form for this to work.
Now, onto your question.
1. Add a hyperlink in Forms Designer (drag Hyperlink off from the panel on the left onto the design pane)
2. Add a CSS class to it (click the hyperlink once on the design pane and observe the panel on the right side, you need the "Css Class" entry). Enter for example "mylink".
3. Click the "Javascript" button at the top of Forms Designer and add the following code to it:
4. Save.
Notice, I've used the GetUrlKeyValue function to retrieve the current ID from the URL.
First of all, be sure to check this page to see how to retrieve values off from various form fields: Note, that the field must be present on the actual form for this to work.
Now, onto your question.
1. Add a hyperlink in Forms Designer (drag Hyperlink off from the panel on the left onto the design pane)
2. Add a CSS class to it (click the hyperlink once on the design pane and observe the panel on the right side, you need the "Css Class" entry). Enter for example "mylink".
3. Click the "Javascript" button at the top of Forms Designer and add the following code to it:
Code: Select all
var url = 'http://URL/DispForm.aspx?ID=' + GetUrlKeyValue('ID') + '&RootFolder=*';
$('.mylink').attr('href', url);
Notice, I've used the GetUrlKeyValue function to retrieve the current ID from the URL.
Hello,
I think you misunderstood me. I do not need the ID from the URL.
On my form I have a field with an ID. This ID is not the ID from the URL.
This ID I need in the URL. Can you help me?
I have a second question: How can I build a link to a particular field on my form?
Name: "John Doe"
-> "John Doe" should be a link
Thanks!
I think you misunderstood me. I do not need the ID from the URL.
On my form I have a field with an ID. This ID is not the ID from the URL.
This ID I need in the URL. Can you help me?
I have a second question: How can I build a link to a particular field on my form?
Name: "John Doe"
-> "John Doe" should be a link
Thanks!
Sorry, I didn't insert the actual link I meant to insert. Please check this page for a complete reference on how to set/get field values: http://spform.com/forms-designer- ... eld-values
So, if your field is a text type for example, you'd get its field value like this:
Regarding your second question, would that be for the display form?
So, if your field is a text type for example, you'd get its field value like this:
Code: Select all
fd.field('MyFieldsInternalName').value();
Use:
Replacing "InternalName" as appropriate
Code: Select all
fd.field('InternalName').control()._el().wrap('<a href="https://google.com"></a>')
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests