fanfavorite Posted January 23, 2008 Share Posted January 23, 2008 I use Ajax to update forms, so for instance: <div class="formsleft">Do you want to buy apples?</div> <div class="formsright"> <select name="buyapples" onchange="showField(this.value,'quantity')"> <option value="No"<? if ($_POST['buyapples'] == "No") { echo ' selected="selected"'; } ?>>No</option> <option value="Yes"<? if ($_POST['buyapples'] == "Yes") { echo ' selected="selected"'; } ?>>Yes</option> </select> </div> <div id="quantity"></div> So whatever I click, shows that option in the id. Now my problem is if I want to do an onchange with the updated content like so: <div class="formsleft">Do you want to buy apples?</div> <div class="formsright"> <select name="buyapples" onchange="showField(this.value,'quantity')"> <option value="No"<? if ($_POST['buyapples'] == "No") { echo ' selected="selected"'; } ?>>No</option> <option value="Yes"<? if ($_POST['buyapples'] == "Yes") { echo ' selected="selected"'; } ?>>Yes</option> </select> </div> <div id="quantity"> <div class="formsleft">How many apples do you want to buy?</div> <div class="formsright"> <select name="applequantity" onchange="showField(this.value,'appletype')"> <option value="1"<? if ($_POST['applequantity'] == "1") { echo ' selected="selected"'; } ?>>1</option> <option value="2"<? if ($_POST['applequantity'] == "2") { echo ' selected="selected"'; } ?>>2</option> </select> </div> </div> <div id="appletype"></div> When I choose yes to buy apples, the code shows in the quantity id. Then when I choose how many, it loads content into the appletype id. This works fine in Firefox, but throws an "Unknown Runtime Error" in IE7. Any ideas why? Thanks, -JC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.