-
Notifications
You must be signed in to change notification settings - Fork 13
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
Is it possible to write to the VZ address field from a front-end entry form? #26
Comments
Shanan, I am at a conference for the rest of this week, so I probably won't have time until next week to take a deeper look at this. This particular use-case isn't something I have encountered before, so I don't know the answer off the top of my head. In the mean time, you could try looking at the field names in the back-end, but I assume that is already where you got the code above. |
Very good, thank you. Enjoy the conference (Peers?). I have a workaround, but am still curious how to populate/edit the array in the VZ address field from a front-end entry form. |
Yes, I was at Peers....it was great! I'm not sure I totally understand the setup you are trying to achieve here. Is it just an Address field, or an address inside of a Matrix? If it's in a Matrix, something like the following should work: <div class="vzaddress-fields">
<div class="field">
<label for="fields-location-name">Name</label>
<input type="text" id="fields-location-name" name="fields[matrix_field][new1][address_field][name]">
</div>
<div class="field">
<label for="fields-location-street">Street Address</label>
<input type="text" id="fields-location-street" name="fields[matrix_field][new1][address_field][street]">
</div>
<div class="field">
<label for="fields-location-street2">Street Address 2</label>
<input type="text" id="fields-location-street2" name="fields[matrix_field][new1][address_field][street2]">
</div>
<div class="field">
<label for="fields-location-city">City</label>
<input type="text" id="fields-location-city" name="fields[matrix_field][new1][address_field][city]">
</div>
<div class="field">
<label for="fields-location-region">State/Province</label>
<input type="text" id="fields-location-region" name="fields[matrix_field][new1][address_field][region]">
</div>
<div class="field">
<label for="fields-location-postalCode">Postal Code</label>
<input type="text" id="fields-location-postalCode" name="fields[matrix_field][new1][address_field][postalCode]">
</div>
<div class="field">
<label for="fields-location-country">Country</label>
<select id="fields-location-country" name="fields[matrix_field][new1][address_field][country]"> .... </select>
</div>
</div> Let me know if I'm misunderstanding your problem, though.... |
I'm closing this. If you are still having problems with the front-end entry form, feel free to re-open. |
Eli,
Thank you — I ended up with a different approach for the live project, but had held the issue aside with the hope of carving some time out to try out the fix with earlier prototype. I really appreciate your plugin and being able to populate it through a front-end form will be very helpful in future projects. I appreciate your attention on this!
Thank you,
Shanan.
…_________________________________________________________
Swink | 106 East Doty Street, Suite 310 | Madison, Wisconsin 53703
On Jun 14, 2017, at 8:35 PM, Eli Van Zoeren ***@***.***> wrote:
I'm closing this. If you are still having problems with the front-end entry form, feel free to re-open.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#26 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAQ9fQRQG9J9hyQAayEG1d3w8NMLnhDAks5sEIpZgaJpZM4NH-MO>.
|
Sounds good. If & when you end up coming back to it, you will want to take a look at my sample code on Issue #27 as well. |
I am looking to write to the VZ address field array from a front-end entry form, in this case saved as a part of a user's profile. For a matrix, the input field would look something like (VZ address field = member_location with the standard field values):
<input type="hidden" name="fields[member_location]" /> {% if currentUser.member_location|length %} {% for locale in currentUser.member_location %} <input type="hidden" name="fields[member_location][{{ locale.id }}][type]" value="..nameOfMatrixBlock.."> <input type="hidden" name="fields[member_location][{{ locale.id }}][enabled]" value="1"> <input type="text" name="fields[member_location][{{ locale.id }}][fields][street]" value="{{ currentUser.member_location.street }}" placeholder="Address 01" /><br /> <input type="text" name="fields[member_location][{{ locale.id }}][fields][street2]" value="{{ currentUser.member_location.street2 }}" placeholder="Address 02" /><br /> <input type="text" name="fields[member_location][{{ locale.id }}][fields][city]" value="{{ currentUser.member_location.city }}" placeholder="City" /><br /> <input type="text" name="fields[member_location][{{ locale.id }}][fields][region]" value="{{ currentUser.member_location.region }}" placeholder="State" /><br /> <input type="text" name="fields[member_location][{{ locale.id }}][fields][postalCode]" value="{{ currentUser.member_location.postalCode }}" placeholder="ZIP Code" />
...but Matrix is not writing to an array in a single field. Can you give guidance on how to access a VZ address field from a front-end form? Thank you!
The text was updated successfully, but these errors were encountered: