Here is the fiddle : http://jsfiddle.net/rbmako69/t5qKs/12/
here is the form:
<form id="form1" mrthod="get" action="#">
<div date-role="fieldcontain" class="ui-hide-label">
<label for="best_contact_method">Best Contact Method</label>
<select data-theme="a" id="best_contact_method" name="best_contact_method" class="required" data-native-menu="false">
<option>Best Contact Method</option>
<option value="email">Email</option>
<option value="daytime_phone">Daytime Phone</option>
<option value="evening_phone">Evening Phone</option>
</select>
</div>
<div data-role="fieldcontain" class="ui-hide-label">
<label for="daytime_phone" id="daytime_phone_label">Daytime Phone</label>
<input type="text" id="daytime_phone" name="daytime_phone" placeholder="Daytime Phone" />
</div>
<div data-role="fieldcontain" class="ui-hide-label">
<label for="evening_phone" id="evening_phone_label">Evening Phone</label>
<input type="text" id="evening_phone" name="evening_phone" placeholder="Evening Phone" />
</div>
<div data-role="fieldcontain" class="ui-hide-label">
<label for="email" id="email_label">Email</label>
<input type="text" id="email" name="email" placeholder="Email" />
</div>
<button type="submit" data-theme="a" name="submit" id="submit" value="validate">Validate</button>
</form>
The form has 4 elements, a select box, 3 text inputs, and a button. When you select an option from the select, it changes which field is required to submit the form. When you select on option from the drop down, you will see that the input fields changes its formatting. The validation works fine, but I can't seem to figure out how to keep the formatting of the field from changing.
Any suggestions?