hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Joomla "select onchange" help?
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Joomla "select onchange" help?

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-11-2010, 05:14 AM
jwebhost jwebhost is offline
Web Hosting Master
 
Join Date: Jun 2009
Location: UK: Oxford
Posts: 1,242

Joomla "select onchange" help?


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??

__________________
Pub, Gym and Programming is now my life.

Reply With Quote


Sponsored Links
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
How efficient are topic titles like "BLOWOUT", "SPECIAL" and "KILLER OFFER"? BluewaveHosted Running a Web Hosting Business 18 06-30-2009 11:21 AM
How to "Reduce your SELECT DISTINCT queries without LIMIT clauses" kotlt Hosting Security and Technology 1 03-28-2009 04:10 PM
How to make a "select all" with checkboxes or radio buttons kenfused Programming Discussion 2 12-02-2004 11:20 AM
<select name=\"prod_id\" onchange=\"this.form.submit();\">"; stephenvs Programming Discussion 4 05-27-2004 12:59 PM
Drams System - "Unable to Select Database" Error - Please Help Iveraweb Hosting Software and Control Panels 0 05-24-2004 10:39 AM

Related posts from TheWhir.com
Title Type Date Posted
Open Source Content Management System Joomla Surpasses 36 Million Downloads Web Hosting News 2012-11-29 16:38:54
Open Source Content Management System Joomla Surpasses 30 Million Downloads Web Hosting News 2012-04-04 15:10:30
Joomla Releases Version 2.5 With SQL Server Support Web Hosting News 2012-01-24 13:34:24
Open Source CMS Joomla Hits 25 Million Downloads Web Hosting News 2011-09-14 17:17:03
Open Source Developer Joomla Releases 1.7 CMS with Enhanced Security Tools Web Hosting News 2011-07-19 18:51:20


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?