Append form input values with some text
Merry Christmas and Happy Holidays to one & all!
I'm wondering if there's a way to append from input values with some text contained inside a title attribute on form SUBMIT.
My goal is to grab a value from the input entries and then prefix those values with some descriptive text as the form is being submitted to a shopping cart.
Example:
<form method="post" action="https://shopping_cart/ID">
<label for="arrival">Arrival Date:</label>
<input name="arrival" id="arrival" type="text" value="" title="Arrival Date:" required placeholder="mm/dd/yyyy">
<label for="nights># of Nights:</label>
<input name="nights" id="nights" value="" title="# of Nights:" type="number" min="1" required placeholder="How many nights?">
<label for="guests"># of Guests:</label>
<input name="guests" id="guests" value="" title="# of Guests:" type="number" min="1" required placeholder="How many in your group?">
<button type="submit">ADD TO CART</button>
</form>
So the result in the cart would read:
Arrival Date: (value from datepicker)
#of Nights: (value from nights input)
# of Guests: (value from guests input)
I have tried this a few different ways with straight JS and jQuery but all have failed for various reasons.
Am I spitting into the wind with this? If so, I'll quit now and call it a day
.
Nancy O.

