Jump to content

Using textbox instead of Dropdown in Schedule Search


Recommended Posts

Posted

Hello!

 

I'm hoping someone can help! I'm looking to use a search text box instead of a dropdown menu on our Schedule Search page (http://flyhighva.net/index.php/schedules) I'm smart enough to realize that the file I want to play around with is schedule_searchform.php   I am NOT smart enough, however, to mess around too much without breaking something. I'm good at editing and building off of someone else's start - but I for the life of me can't start something new (if that makes any sense, lol) 

 

The area of code I'm looking at changing to allow a pilot to enter a ICAO code instead of searching the never-ending dropdown menu is lines 16 thru 45:

	<div id="depapttab">
		<p>Select your departure airport:</p>
		<select id="depicao" name="depicao">
		<option value="">Select All</option>
		<?php
		if(!$depairports) $depairports = array();

		foreach($depairports as $airport) {
			echo '<option value="'.$airport->icao.'">'.$airport->icao
					.' ('.$airport->name.')</option>';
		}
		?>

		</select>
		<input type="submit" name="submit" value="Find Flights" />
	</div>
	<div id="arrapttab">
		<p>Select your arrival airport:</p>
		<select id="arricao" name="arricao">
			<option value="">Select All</option>
		<?php
		if(!$depairports) $depairports = array();

		foreach($depairports as $airport) {
			echo '<option value="'.$airport->icao.'">'.$airport->icao
					.' ('.$airport->name.')</option>';
		}
		?>

		</select>

Any suggestions on where to start? Using Simpilot's 5.5x version of phpVMS.

 

Thanks!

 

Posted

I would change this:

<select id="depicao" name="depicao">
  <option value="">Select All</option>
  <?php
  if(!$depairports) $depairports = array();

  foreach($depairports as $airport) {
   echo '<option value="'.$airport->icao.'">'.$airport->icao
     .' ('.$airport->name.')</option>';
  }
  ?>
</select>

to this:

<input type="text" name="depicao" id="depicao" placeholder="Enter Departure ICAO..." />

 

and do the same for the arrival airport as well, just change all the depicao to arricao in the new input.

 

Hope that helps.

Posted
4 hours ago, web541 said:

I would change this:


<select id="depicao" name="depicao">
  <option value="">Select All</option>
  <?php
  if(!$depairports) $depairports = array();

  foreach($depairports as $airport) {
   echo '<option value="'.$airport->icao.'">'.$airport->icao
     .' ('.$airport->name.')</option>';
  }
  ?>
</select>

to this:


<input type="text" name="depicao" id="depicao" placeholder="Enter Departure ICAO..." />

 

and do the same for the arrival airport as well, just change all the depicao to arricao in the new input.

 

Hope that helps.

 

 

Worked like a charm. Thanks for the assist!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...