Month year expiration drop down in Stripe form angularjs - angularjs

I am using Stripe with my angularJs app. Although the code below works fine, I wanted a month, year drop down for the expiry date.
<form stripe-form="stripeCallback" name="checkoutForm">
<input ng-model="number" placeholder="Card Number"
payments-format="card" payments-validate="card" name="card"/><br>
<input ng-model="expiry" placeholder="Expiration"
payments-format="expiry" payments-validate="expiry"
name="expiry"/><br>
<input ng-model="cvc" placeholder="CVC" payments-format="cvc" payments-validate="cvc" name="cvc"/><br>
<button class="checkout" type="submit" ng-disabled="checkoutForm.card.$invalid">Checkout</button>
</form>
How do I integrate two drop downs with this form?
Thanks.

Something along these lines would probably give you what you need.
<select ng-model='expiry_month' ng-change='expiry=expiry_month+"/"+expiry_year'>...</select>
<select ng-model='expiry_year' ng-change='expiry=expiry_month+"/"+expiry_year'>...</select>

Related

Angular JS URL Validation

We have to validate a value give by users for URL Field.
System ask Facebook, Twitter, Google+ & etc
Can anyone suggest us with best way.
We are using the following pattern,
/((?:https?\:\/\/www\.)|(?:[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$))/i
Thanks,
You can start with using input type as url
example
<form name="form1" ng-controller="x">
<label>Enter Site Name:</label>
<input type="url" ng-model="initialwebsite" name="name" required />
<span style="color:red" ng-show="form1.name.$error.required">
You Can't Leave This Field Empty</span>
<span style="color:red" ng-show="form1.name.$error.url">
Sorry Not a Valid URL, Don't Forget to Use http://</span>
<input type="submit" value="Submit"/>
</form>
For further validation you can refer this link
As example, you can try this one
"#([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*#)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)*)*|(\/((([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)+(\/(([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)*)*)?)|((([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)+(\/(([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)*)*)|((([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)){0})(\?((([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)|[\xE000-\xF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\x00A0-\xD7FF\xF900-\xFDCF\xFDF0-\xFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|#)|\/|\?)*)?#iS"

How to apply range in datetimepicker

I am having below code in angular view page to apply date range.
<input type="text"
ui-options="{format: 'DD-MMM-YYYY'}"
min-date="02/10/86"
max-date="today"
ui-jp="datetimepicker"
class="form-control">
and it is not working.
Thanks for your time.

how to show calendar in nginput[date] when click the input

I have a date input like this:
<input type="date" name="input" ng-model="date" placeholder="yyyy-MM-dd" class="form-control"/>
Now I want show calendar when click the input. How to controller the date calendar?
<input type="date"> is implemented on the level of the browser. I use Chrome and I do see datetime field.

Display Calendar in Woocommerce Booking

I am using the new Woocommerce bookings and would like the calendar to be displayed permanently, instead of having users click the "choose" option that then displays the text.
I am too much of a novice to display pictures in this foru, so here is the link instead.
I would like the bottom one to be displayed permanently.
The source code looks like this:
<fieldset class="wc-bookings-date-picker wc_bookings_field_start_date">
<legend>Start Date: <small>Choose...</small></legend>
<div class="picker" data-availability="[["days",{"6":true}],["days",{"4":true}],["time",{"from":"11:30","to":"13:30","rule":true,"day":0}]]" data-default-availability="false" data-fully-booked-days="{"2014-6-8":[true]}" data-min_date="+0d" data-max_date="+12m"></div>
<label>
<input type="text" value="2014" name="wc_bookings_field_start_date_year" placeholder="YYYY" size="4" class="required_for_calculation booking_date_year" />
<span>Year</span>
</label> / <label>
<input type="text" name="wc_bookings_field_start_date_month" placeholder="mm" size="2" class="required_for_calculation booking_date_month" />
<span>Month</span>
</label> / <label>
<input type="text" name="wc_bookings_field_start_date_day" placeholder="dd" size="2" class="required_for_calculation booking_date_day" />
<span>Day</span>
</label>
not sure if you figured this out yet or not, but Bookings now has a selection button to always show the Datepicker. Edit your Bookings product, and on the General tab, next to Calendar display mode select Calendar always visible from the drop-down menu. That should do it, no coding needed!

Angular form that contains nested directive not validating

I have a very simplified bit of html like so:
<call-panel>
<form name="hotListForm" >
<twilio>
<input type="text" name="phoneOtherText" id="phoneOtherText" class="form-control" required="required" ng-model="phoneNumber" ng-pattern="validation" ng-trim="false"/>
<span class="error" ng-show="hotListForm.phoneOtherText.$error.pattern">Not a valid phone number</span>
</twilio>
</form>
</call-panel>
But this doesn't work. Is there a special way to do this when in a nested directive. I have verified pattern is available.
Screenshot of it definitely being in the form and of form structure:
It is not working probably because you have the id set to "phoneOtherText" as well, try changing the id and try

Resources