Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining name and id props does not POST the inner input #28

Closed
Gildedter opened this issue Sep 29, 2022 · 4 comments
Closed

Defining name and id props does not POST the inner input #28

Gildedter opened this issue Sep 29, 2022 · 4 comments

Comments

@Gildedter
Copy link

Specifically for DateInput, I have this code:

<label for="dateTaken" class="form-label"
    >Date Taken</label
>
<DateInput
    bind:value={dateTaken}
    format="yyyy/MM/dd"
    placeholder="Not set"
    id="dateTaken"
    name="dateTaken"
/>
{dateTaken}

within my form tag, upon submit, I see my other fields on the incoming post request except for dateTaken, submitting this issue before a doing a simple fork, not sure if adding those two fields would mess with the existing functionality

@probablykasper
Copy link
Owner

DateInput doesn't have any name or id prop. FormData only supports strings/blobs, so I'm not sure how this should really be implemented

@AndreasPB
Copy link

I'm also interested in this to be able to pull the value out of the form from my +page.server.ts file

@probablykasper probablykasper closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2022
@Gildedter
Copy link
Author

I haven't found a correct implementation, since DateInput's "value" is a Date type, FormData api can't pass it (even boolean is turned to string from my testing), I saw a text prop which contains the text version of the currently selected date, would setting that as the input's value property work?

@probablykasper
Copy link
Owner

That wouldn't work for DatePicker, and it's probably not a good idea to have the user-facing format be used for it because you might want to change the format users see, or have locale-specific formats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants