|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
I'm wanting to make customfield3 into a dropdown which states: and i want it to require users to select one or the other (using values i know, but making the form is what i'm having issues with since i viewed presant options). I'd also like to have it so that it's required as well in the followign areas: cp edit profile (cp_edit_profile.pl) public edit profile (public_edit_profile.pl) registrations (public_register_form.pl) note that the file names canbe off a bit since i'm running on 0 sleep... Any help would be greatly appreciated.
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Ok, so far I have: Replace: input type="text" name="customfield3" value="$user_profile[18]" size="35" maxlength="80" /> With: <select name="customfield3"> <option>$vars_wordlets_mods{gender_select}</option> <option>$vars_wordlets_mods{gender_selector}</option> <option value="Male">$vars_wordlets_mods{gender_male}</option> <option value="Female">$vars_wordlets_mods{gender_female}</option> </select></select> Which sets the profile field to male or female, BUT, how would i go about making it have one selected when viewed in edit profile lol, it just shows "select"
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
try using... if($user_profile[16] eq 'Male') { my $maleselect = qq! selected="selected"!; } else { my $maleselect = qq! !; }
if($user_profile[16] eq 'Female') { my $femaleselect = qq! selected="selected"!; } else { my $femaleselect = qq! !; }
if($user_profile[16] eq '') { my $femaleselect = qq! selected="selected"!; } else { my $femaleselect = qq! !; }
<select name="customfield3"> <option>$vars_wordlets_mods{gender_select}</option> <option>$vars_wordlets_mods{gender_selector}</option> <option value="Male" $maleselect>$vars_wordlets_mods{gender_male}</option> <option value="Female" $femaleselect>$vars_wordlets_mods{gender_female}</option> </select> (note: I made it default to female to avoid being a chauvenist pig. gotta love the times we live in )
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
where do i put the if/else statements?
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
oh, and you could have made "select" the default statement :x...
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
FIND: ===== <input type="text" name="customfield3" value="$user_profile[18]" size="35" maxlength="80" /> REPLACE WITH: ============== if($user_profile[18] eq 'Male') { my $maleselect = qq! selected="selected"!; } else { my $maleselect = qq! !; }
if($user_profile[18] eq 'Female') { my $femaleselect = qq! selected="selected"!; } else { my $femaleselect = qq! !; }
if($user_profile[18] eq '') { my $femaleselect = qq! selected="selected"!; } else { my $femaleselect = qq! !; }
<select name="customfield3"> <option>$vars_wordlets_mods{gender_select}</option> <option>$vars_wordlets_mods{gender_selector}</option> <option value="Male" $maleselect>$vars_wordlets_mods{gender_male}</option> <option value="Female" $femaleselect>$vars_wordlets_mods{gender_female}</option> </select>
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
new gameplan, now that I looked at the file FIND: ===== if (($vars_registration{custom4_field_use} ne 'DEL') && ($vars_registration{customfield3} ne '')) {
if ($vars_registration{custom3_field_use} eq 'REQ') { $B1 = '<b>'; $B2 = '</b>'; } else { $B1 = ''; $B2 = ''; } ADD AFTER: ========== if($user_profile[18] eq 'Male') { my $maleselect = qq! selected="selected"!; } else { my $maleselect = qq! !; }
if($user_profile[18] eq 'Female') { my $femaleselect = qq! selected="selected"!; } else { my $femaleselect = qq! !; }
if($user_profile[18] eq '') { my $femaleselect = qq! selected="selected"!; } else { my $femaleselect = qq! !; } THEN FIND: ========== <input type="text" name="customfield3" value="$user_profile[18]" size="35" maxlength="80" /> AND REPLACE IT WITH: ==================== <select name="customfield3"> <option>$vars_wordlets_mods{gender_select}</option> <option>$vars_wordlets_mods{gender_selector}</option> <option value="Male" $maleselect>$vars_wordlets_mods{gender_male}</option> <option value="Female" $femaleselect>$vars_wordlets_mods{gender_female}</option> </select> try that
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
ratio buttons, dropdown, so long as it works :x...
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ok, here we go. in public_edit_profile.pl
find: <input type="text" name="customfield2" value="$user_profile[17]" size="35" maxlength="80" /> </td> </tr>
THISFIELD
} # end field
add after:
if($user_profile[18] eq 'Female') { $male_yes = ''; $male_no = qq( checked="checked"); } else { $male_no = ''; $male_yes = qq( checked="checked"); }
find:
<input type="text" name="customfield3" value="$user_profile[18]" size="35" maxlength="80" />
replace with:
<input type="radio" name="customfield3" value="Male" $male_yes /> $vars_wordlets_mods{male_option}
<input type="radio" name="customfield3" value="Female" $male_no /> $vars_wordlets_mods{female_option}
Also, just for cosmetic purposes...
find:
<td> <font size="$vars_style{TextSize}" face="$vars_style{FontFace}"> $B1$vars_registration{customfield3}$B2:
replace with:
<td valign="top"> <font size="$vars_style{TextSize}" face="$vars_style{FontFace}"> $B1$vars_registration{customfield3}$B2:
in vars_wordlets_mods.cgi
find: %vars_wordlets_mods = (
add after:
q!female_option! => q!Female!, q!male_option! => q!Male!, that should do it. It defaults to Male.
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
ok, you just asked for public_register_form.pl so here find: $vars_registration{customfield3}, "", "customfield3", "text", 35, 80, 0);
replace with:
$vars_registration{customfield3}, "", "customfield3", "radio", { Male => $vars_wordlets_mods{male_option}, Female => $vars_wordlets_mods{female_option} }, [qw(Male Female)], Male);
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Sweet, with adding that in, and tweaking the positioning of custom3, i have a very nice outlook ... Thanks al ...
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
you can try this for the cp. in cp_edit_profile.pl find: if (($vars_registration{custom3_field_use} ne 'DEL') && ($vars_registration{customfield3} ne '')) {
if ($vars_registration{custom3_field_use} eq 'REQ') { $B1 = '<b>'; $B2 = '</b>'; } else { $B1 = ''; $B2 = ''; }
&AlternateColors;
print <<THISFIELD;
<tr bgcolor="$vars_style_cp{AltColumnColorCurrent}"> <td class="autorow"><span class="autorow-title" style="font-weight: normal;"> $B1$vars_registration{customfield3}$B2: </td><td class="autorow"><span class="autorow-options"> <INPUT TYPE="TEXT" NAME="customfield3" value="$user_profile[18]" SIZE="35" MAXLENGTH="80"> </span></td> </tr> THISFIELD
} # end field
replace with:
if($user_profile[18] eq 'Female') { $male_yes = ''; $male_no = qq( checked="checked"); } else { $male_no = ''; $male_yes = qq( checked="checked"); }
if (($vars_registration{custom3_field_use} ne 'DEL') && ($vars_registration{customfield3} ne '')) {
if ($vars_registration{custom3_field_use} eq 'REQ') { $B1 = '<b>'; $B2 = '</b>'; } else { $B1 = ''; $B2 = ''; }
&AlternateColors;
print <<THISFIELD;
<tr bgcolor="$vars_style_cp{AltColumnColorCurrent}"> <td class="autorow"><span class="autorow-title" style="font-weight: normal;"> $B1$vars_registration{customfield3}$B2: </td><td class="autorow"><span class="autorow-options"> <input type="radio" name="customfield3" value="Male" $male_yes /> $vars_wordlets_mods{male_option}
<input type="radio" name="customfield3" value="Female" $male_no /> $vars_wordlets_mods{female_option} </span></td> </tr> THISFIELD
} # end field
|
|
|
|
Joined: Jan 2000
Posts: 5,833 Likes: 20
UBBDev / UBBWiki Owner Time Lord
|
UBBDev / UBBWiki Owner Time Lord
Joined: Jan 2000
Posts: 5,833 Likes: 20 |
Hey al, how about that cp mod for 6.6.1?
|
|
|
|
Joined: Jan 2003
Posts: 3,456 Likes: 2
Master Hacker
|
Master Hacker
Joined: Jan 2003
Posts: 3,456 Likes: 2 |
I'll look into it like Fridayish. I've got 2 essays to write
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 21,079
Joined: March 2000
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|