Form-based buttons (see Listing 4–2) are actually easier to style than link-based buttons because no modifications are required on your part. For simplicity, the framework automatically converts any button
or input
element into a mobile-styled button for you (see Figure 4–2).
Listing 4–2. Form buttons (ch4/form-buttons.html)<button type="submit">Button element</button>
<input type="button" value="button" />
<input type="submit" value="submit" />
<input type="reset" value="reset" />
Figure 4–2. Form buttons
TIP If you want to disable the automatic initialization of form buttons or any other control, you may add the data-role=”none”
attribute to the element and jQuery Mobile will not enhance the control:
<button data-role=”none”>Button element</button>
Leave a Reply