Incredibly easy with javascript.
First google result: http://www.webmasterworld.com/forum91/1560.htm
I did see that, but how can I do that with the way buddypress is set up? What files do I need to edit basically?
Does anyone know how to implement this into the profile fields on buddypress?
i have same need.
is there any plugin to make more advanced profile fields??
another thing i need is when people select for example country from a combobox next combobox load cities of that country so he can select city of country.
any plugins?
Any luck with this yet Nick? I’m also wanting to do the same thing, javascript would be great with a little more instruction
I found a way to hide the list if they didn’t choose the suggested number but ideally I would like it to give them a pop up notification that you can only select 5 instead of just being listed in the description under the box.
<?php if ( count($expertise) <= 5 ) : ?>
<div class="expertise">
<p><strong>Areas of Expertise:</strong></p>
ul>
<?php $track <= 5; foreach ( $expertise as $area ) : $track++; ?>
<li><?php echo $area; ?></li>
<?php if ( $track== ceil( count($expertise) / 3 ) ) : $track = 0; ?>
/ul>
ul>
<?php endif; ?>
<?php endforeach; ?>
/ul>
</div>
<?php endif; ?>
This is located in the member-header.php
javascript:
function checkboxlimit(checkgroup, limit){
for (var i=0; i<checkgroup.length; i++){
checkgroup[i].onclick=function(){
var checkedcount=0
for (var i=0; i<checkgroup.length; i++)
checkedcount+=(checkgroup[i].checked)? 1 : 0
if (checkedcount>limit){
alert("You can select a maximum of "+limit+" boxes.")
this.checked=false
}
}
}
}
checkboxlimit(document.forms.your_form_name_or_id['field_name[]'], 5);
format got messed up, so look here for a non-jQuery approach: http://pastebin.com/0afNVh3e