hi everyone;
I'm in need of some help.
I am building a little website for my brother, and he wants a good dynamic profile application. However, I'm having some trouble with the dropdowns for searching with specific critera.
The dropdowns are populated in the administrator and are displayed using:
Code:
<form name="jsform-profile-edit" id="frmSaveProfile" action="<?php echo CRoute::getURI(); ?>" method="POST" class="community-form-validate">
<select onchange="if (this.selectedIndex==1){this.form['box'].style.visibility='visible'}else {this.form['box'].style.visibility='hidden'};">
<?php echo $beforeFormDisplay;?>
<?php
foreach ( $fields as $name => $fieldGroup )
{
if ($name != 'ungrouped')
{
?>
<div class="ctitle">
<h2><?php echo JText::_( $name );?></h2>
</div>
<?php
}
?>
<table class="formtable" cellspacing="1" cellpadding="0" style="width: 98%;">
<tbody>
<?php
foreach ( $fieldGroup as $f )
{
$f = JArrayHelper::toObject ( $f );
$f->value = $this->escape( $f->value );
?>
<tr>
<td class="key"><label id="lblfield<?php echo $f->id;?>" for="field<?php echo $f->id;?>" class="label"><?php if($f->required == 1) echo '*'; ?><?php echo JText::_( $f->name );?></label></td>
<td class="value"><?php echo CProfileLibrary::getFieldHTML( $f , '' ); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
<table class="formtable" cellspacing="1" cellpadding="0">
<tr>
<td class="key"></td>
<td class="value"><span class="hints"><?php echo JText::_( 'CC_REG_REQUIRED_FILEDS' ); ?></span></td>
</tr>
</table>
<?php echo $afterFormDisplay;?>
<table class="formtable" cellspacing="1" cellpadding="0" style="width: 98%;">
<tbody>
<tr>
<td class="key"></td>
<td class="value">
<input type="hidden" name="action" value="save" />
<input class="validateSubmit button" type="submit" value="<?php echo JText::_('CC BUTTON SAVE'); ?>" />
</td>
</tr>
</tbody>
</table>
</form>
However, the code I want to use is to display a text box if what the user is looking for isn't populated in the dropdown menu
Code:
<select onchange="if (this.selectedIndex==1){this.form['box'].style.visibility='visible'}else {this.form['box'].style.visibility='hidden'};">
But this will only select the 2nd option in the dropdowns, I want it to change if the option selected is "Other".
How do i do this??