Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Making drop-down menu hide, but choosing a 'selected' default option

    I'm using the GMapFP component on a Joomla! page and am struggling to make a directions portion work when it looks how I want it too.

    The link is:
    http://tinyurl.com/phpquestion

    I'm trying to make the FROM only have the text line, but whenever I remove the options pulldown, it looks correct, but code doesn't work.

    On the TO portion, I'm trying to make the dropdown menu already have an item selected and remove the "Click here ..." option.

    In the code below, the "GMAPFP_CHOIX_VERS" is the JText for "Click here ..."

    Code:
    	<select name="select_to'.$num.'" id="select_to'.$num.'">
    	<option value="">'.JText::_( 'GMAPFP_CHOIX_VERS' ).'</option>';
    		foreach($rows_orderA as $row) {
    	$selected = '';
    		if (isset($row->glat) && isset($row->glng) && !empty($row->glat) && !empty($row->glng)) {
    	$value = $row->glat.','.$row->glng;
    	} else {
    		$value = @$row->pay.' '.@$row->codepostal.' '.@$row->ville.' '.@$row->adresse.' '.@$row->adresse2;
    		}
    		$carte .= '<option value="'.$value.'" '.$selected.'>'.$row->nom.'</option>';
    	}
    	$carte.='
    	</select>
    Ideally, I could hide the whole TO part and just have the store's destination be set.

    Do I need to include any more code or detail?

  • #2
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Coding <select> and <option> on Joomla's GMapFP

    Any ideas? I can make the parts I want disappear, but then the script doesn't function.

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm getting closer. I have the "From" drop-down menu removed, but the script still functional. Now, I'm trying to make the "To" drop-down menu not show, but have the store location as the default. So it only appears as 'enter starting point here' and hit enter, then directions to the destination will appear without people needing to select it from the drop-down menu.

    Again:
    http://tinyurl.com/phpquestion


    Thanks


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •