The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

I can't make the phone field required

a9ka9k Member
in Bugs & Feature Requests edited July 2008
Here is what I have in checkout. I think I've followed the rules but in preview the phone field still doesn't have an asterisk. I tried moving the javascript to head, tried just before end of body. Nothing works for me.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">;
<html xmlns="">;
	<title>^^store_name^^ Checkout</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" href="https://^^store_domain^^/themes/text/styles.css"; type="text/css" media="screen" charset="utf-8" />

<body id="checkout">
	<div id="pageContainer" style="width:760px; margin:0px auto;">
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
		// add the required class
		// add an asterisk to the label
		$j("#li_customer_phone label.fc_label_left").append("<span class=\"fc_ast\">*<\/span>");
		// add an error label after the phone
		$j("#customer_phone").after('<label for="customer_phone" class="fc_error" style="display:none">Please enter your phone number.<\/label>');

		// Now add the onblur error checking events
		$j("#customer_phone").blur(function() {
			if (this.value == "") {
			} else {
/* ]]> */

<h2>Additional Information</h2>
<fieldset id="fc_custom_fields">
	<legend>Additional Information</legend>
	<div class="fc_inner">
			<input type="checkbox" name="Update_List" value="yes" checked="checked" />
			<label for="Update_List">Leave this box checked to receive occasional updates about our products. We will not share your email address, and you can unsubscribe at any time.</label>
			<p>If you have any comments about your order, or about our checkout process, please let us know.</p>
			<textarea name="Comments" cols="60" rows="4"></^^textarea^^>
	</div><!-- .fc_inner -->
</fieldset><!-- #fc_custom_fields -->
  • lukeluke FoxyCart Team
    Hey a9k.

    Unfortunately... I'm about to give you the standard "it works on my computer" answer. I used the code you pasted here and it worked exactly as expected in FireFox 2. Are you using FireBug? Do you see any errors? What browser and browser version are you using?
  • brettbrett FoxyCart Team
    @a9k: Did you get this working? If you want to whisper me your URL I'll take a look.
  • a9ka9k Member
    Sorry I just got back from 4200 mile drive visiting my kids, and barely avoiding Sturgis.
    We're setup and running at:
    if you want to take a look.
  • brettbrett FoxyCart Team
    Hey a9k.
    I'm testing in FF3 and Safari 3 and I'm seeing the asterisk and the required behavior as expected. Did you get this sorted out? Looks like it, but if not let me know specifically what's not behaving as it should.
Sign In or Register to comment.