Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Making a form dynamic?

Featured Replies

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!! :bangb:

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>

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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.