Answers.Body: <p>Found a solution by inspecting the HTML for the entry edit form in the CP. This works:</p>
  
  <pre><code>&lt;input id="fields-website-type" name="fields[website][type]" value="url" type="hidden"&gt;
  &lt;input id="fields-website-isCpFormData" name="fields[website][isCpFormData]" value="true" type="hidden"&gt;
  &lt;input id="website" type="text" name="fields[website][url]"&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-01T15:18:21.280Z
Answers.LastActivityDate: 2018-12-01T15:18:21.280Z
Answers.UserDisplayName: Udo
Body: <p>I'm editing an entry via an entry form as documented here:
  <a href="https://docs.craftcms.com/v3/dev/examples/entry-form.html" rel="nofollow noreferrer">https://docs.craftcms.com/v3/dev/examples/entry-form.html</a></p>
  
  <p>How would I be able to save a link field that's using <a href="https://github.com/sebastian-lenz/craft-linkfield" rel="nofollow noreferrer">https://github.com/sebastian-lenz/craft-linkfield</a> ?</p>
  
  <p>I tried this:</p>
  
  <pre><code>&lt;input id="website" type="text" name="fields[website]"&gt;
  </code></pre>
  
  <p>(where "website" is the handle of the link field) but that just throws a syntax error (in json_decode) at vendor/sebastianlenz/linkfield/src/fields/LinkField.php:112</p>
  
  <p>It works fine for other  elements that use one of the built-in field types.</p>
  
  <p>Is this even possible using the standard entries/save-entry endpoint? Or would I need to write a custom controller, and how so? </p>
  
Tags: <craft3><custom-fieldtype><link>
Title: Saving a "craft-linkfield" field via an entry form
ThreadText: # Saving a "craft-linkfield" field via an entry form
  
  (Asked by: username_0 on 2018-12-01)
  
  I'm editing an entry via an entry form as documented here:
  <https://docs.craftcms.com/v3/dev/examples/entry-form.html>
  
  How would I be able to save a link field that's using <https://github.com/sebastian-lenz/craft-linkfield> ?
  
  I tried this:
  
  ```
  <input id="website" type="text" name="fields[website]">
  
  ```
  
  (where "website" is the handle of the link field) but that just throws a syntax error (in json\_decode) at vendor/sebastianlenz/linkfield/src/fields/LinkField.php:112
  
  It works fine for other elements that use one of the built-in field types.
  
  Is this even possible using the standard entries/save-entry endpoint? Or would I need to write a custom controller, and how so?
  
  **Tags:** craft3, custom-fieldtype, link
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-12-01. Score: 1
  
  Found a solution by inspecting the HTML for the entry edit form in the CP. This works:
  
  ```
  <input id="fields-website-type" name="fields[website][type]" value="url" type="hidden">
  <input id="fields-website-isCpFormData" name="fields[website][isCpFormData]" value="true" type="hidden">
  <input id="website" type="text" name="fields[website][url]">
  
  ```
  
  
  ---
  
  