Shopify custom code a price of products based on a width field

This is possible in shopify Plz help.

Show a new field for them to enter in the width they would like.

Width: 8,14,22,28,36 Custom

The 8-36 prices are set and can show the price no problems. The custom coding needs to do the following.

  1. When Custom selected a new field will appear to enter in the Width they require
  2. We need to have 3 Meta fields Min Width, Max Width and Price Per Width
  3. The coding needs to validate the entered value is in-between the Min and Max Width
  4. If the number validated within the range, Do the calculation of field Price Per Width X what number they entered.
  5. Go into the shopping cart with that cost and the width they entered.