April 13, 201016 yr I have a registration form here: www.pitlanepass.com/pages/register.php I'm in the very early stage of learning php so the form is created in dreamweaver and emailmeform.com so save that bullet for later!! I have populated several fields using a mysql database and they display and email in a format i'm happy with. for now. The small issue I have is when the organisation is selected and the next field (class) is displayed it lists all classes from the four organisations. Some are repeated and the list is uneccessarily long. For example, Southern Supermoto has only 3 classes but lists all 25! This method allows a registrant to possibly select a class that doesn't exist. I've had similar issues elsewhere ith rider profiles but used $_GET to pull variables from the url but I don't think thats how to achieve it here. Any pointers would be most welcome!! Here's the code snippet from the form... <label>Organisation</label> <select name="FieldData1"> <?php do { ?> <option value="<?php echo $row_rsRegisterorgselect['orgname']; ?>"><?php echo $row_rsRegisterorgselect['orgname']; ?></option> <?php } while ($row_rsRegisterorgselect = mysql_fetch_assoc($rsRegisterorgselect)); ?> </select> <br /> <label>Class</label> <select name="FieldData2"> <?php do { ?> <option value="<?php echo $row_rsClassregister['catname']; ?>"><?php echo $row_rsClassregister['catname']; ?></option> <?php } while ($row_rsClassregister = mysql_fetch_assoc($rsClassregister)); ?> </select>
April 14, 201016 yr There's no quick fix on this one - you are going to need to dive into javascript to do what you want...Javascript isn't my strongest language - but it should be fairly straight forward to do....but your learning curve just got a lot steeper! An alternative way to do it just using php, would be to combine the two lists into one - so you list them as 'Organisation - Class', then have the value set up as something like 'organisation_name:class_name'. Then when the form has been submitted, use php to explode the result by ':' to give you the two separate results that you're looking for.
April 15, 201016 yr Author Thanks for the info both of you, i've achieved what i'd like to in a roundabout kind of way (using two forms on one page!) but now run into another issue that's niggly. The person registering clicks their chosen organisation but it's not clear thye've done it. I've made a separate post regards this issue but I might take a different route out in the meantime... Thanks!! :-)
Create an account or sign in to comment