1

I have a form with about 20 values, half for billing info and half for destination info.

When customer steps through completing the billing info, the destination info is completed with what they entered for billing. They can then change destination info when they reach that part.

As they complete the billing info, the billing input changes from grey placeholder with white background to black entered values with yellow background.

However, this styling does not happen for the destination info that is completed with AMP-bind.

In lieu of adding yet more commands, do you have a quick way to style the completed shipping info with black text and yellow background?

See here for demo https://codepen.io/iamalta/pen/MXEMvO

<form method=post target="_top" action-xhr="https://example.com/thankyou.amp.html" custom-validation-reporting="show-all-on-submit" >
<h3>Billing Information</h3>
<div>
<label for="firstname" aria-hidden="true">First name</label>
  <input 
     type="text" 
     value="" 
     name="firstname" 
     id="firstname" 
     placeholder="Billing First Name" 
     autocomplete="given-name" 
     required 
     on="input-debounced:AMP.setState({dfn: event.value})"
/>
</div>
<div>
<label for="lastname" aria-hidden="true">Last name</label> 
  <input 
     type="text" 
     value="" 
     name="lastname" 
     id="lastname" 
     placeholder="Billing Last name" 
     autocomplete="family-name" 
     required on="input-debounced:AMP.setState({dln: event.value})"
/>
</div>

<h3>Destination Information</h3>
<div>
<label for="destfirstname" aria-hidden="true">First name<span class=red>*</span></label> 
  <input 
     type="text" 
     value="" 
     name="destfirstname" 
     id="destfirstname" 
     placeholder="Destination First name" 
     autocomplete="given-name" 
     required
     [value]="thisdfn != null ? thisdfn : dfn != null ? dfn : ''"    
     on="input-debounced:AMP.setState({thisdfn: event.value})"
/>
</div>
<div>
<label for="destlastname" aria-hidden="true">Last name</label>
  <input 
     type="text" 
     value="" 
     name="destlastname" 
     id="destlastname" 
     placeholder="Destination Last name" 
     autocomplete="family-name" 
     required 
     [value]="thisdln != null ? thisdln : dln!=null ? dln : ''" 
     on="input-debounced:AMP.setState({thisdln: event.value})" 
/>
</div>
<input type="submit" value="Submit" class="ampstart-btn">
</form>

Thank you!

Bachcha Singh
  • 3,850
  • 3
  • 24
  • 38
I am Alta
  • 41
  • 7

0 Answers0