
jmmorse
Novice
May 7, 2002, 9:03 AM
Post #7 of 8
(2893 views)
|
|
Re: [fashimpaur] Need to Change Case from All CAPs to Normal Capitalize
[In reply to]
|
Can't Post
|
|
First of all, I really do appreciate the help you guys are giving me on this! But, I still could not get this to work. I changed the script from this: # Sub: Post New Item sub new2 { my ($title, $reserve, $inc, $desc, $image, $imagea, $imageb, $imagec, $imaged, $imagee, $imagef, $imageg, $imageh, $imagei, $payment, $shipping, $condition, $feat, $paws, $grabber, $bold, $dutch, $qty, $silent, $relister, $buyit, $buyitnow, @bids); if ($form{'REPOST'}) { $form{'REPOST'} =~ s/\W//g; if (-T "$config{'basepath'}$config{'closedir'}/$form{'REPOST'}.dat") { open THEFILE, "$config{'basepath'}$config{'closedir'}/$form{'REPOST'}.dat"; ($title, $reserve, $inc, $desc, $image, $imagea, $imageb, $imagec, $imaged, $imagee, $imagef, $imageg, $imageh, $imagei, $payment, $shipping, $condition, $feat, $paws, $grabber, $bold, $dutch, $qty, $silent, $relister, $buyit, $buyitnow, @bids) = <THEFILE>; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, $imagea, $imageb, $imagec, $imaged, $imagee, $imagef, $imageg, $imageh, $imagei, $payment, $shipping, $condition, $feat, $paws, $grabber, $bold, $dutch, $qty, $silent, $relister, $buyit, $buyitnow, @bids); $title =~ s/\"//g; # quotes cause problems for a text input field, However this does not seem to work. }} print <<"EOF"; <table width=95% cellspacing=0 cellpadding=0 border=0 bgcolor=$config{'colortablehead'}> <tr><td width="100%" align=center><font size=5 color=$config{'colorheadtext'}><b>Post Item For Bids</font></b></td></tr> </table> EOF print "<TABLE width=95% BORDER=0 CELLSPACING=0 CELLPADDING=0>"; print "<FORM ACTION=$ENV{'SCRIPT_NAME'} METHOD=POST>"; print "<INPUT TYPE=HIDDEN NAME=action VALUE=procnew>"; print "<tr><td align=center width=100% BGCOLOR=$config{'colortablebody'}><br></td></tr>"; print "</table>"; print "</tr></table>"; print "<TABLE width=95% BORDER=0 CELLSPACING=0 CELLPADDING=0>"; print "<tr>"; print "<td BGCOLOR=$config{'colortablebody'} width=38%><b>\ \;Select Category:</b></td>"; print "<td align=left BGCOLOR=$config{'colortablebody'} width=62%>"; print "<SELECT NAME=CATEGORY>"; print "<OPTION SELECTED>Select Category</OPTION>"; my $key; foreach $key (sort keys %searchcats) { @cat = split(/ - /,$searchcats{$key}); if ($cat[1] ne "") { print "<OPTION VALUE=$key>$searchcats{$key}</OPTION>\n" if ($searchcats{$key} ne " - "); }} print "</SELECT></TD></TR></table>"; print <<"EOF"; <br><table align="center" bgcolor="white" bordercolor="red" border="1" cellspacing="0" cellpadding="0" width=98%> <tr> <td align=center><TABLE align=center BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR><TD align=center VALIGN=TOP><font face="Verdana, Arial, Helvetica, sans-serif" color="#FF0000" size="3"> Please <u><b>Do Not Use</b></u> Special Characters, Html,<br><b>ALL CAPITALS</b>, or Excessive Spacing ! </font></TD></TR> </TABLE> <TABLE align=center BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR><TD align=center VALIGN=TOP>\ \;<B>Title/Item Name:</B></TD><TD><INPUT NAME=TITLE VALUE=\"$title\" TYPE=TEXT SIZE=50 MAXLENGTH=50 style="text-transform: Capitalize"></TD></TR> </table> To This: # Sub: Post New Item sub new2 { my ($title, $reserve, $inc, $desc, $image, $imagea, $imageb, $imagec, $imaged, $imagee, $imagef, $imageg, $imageh, $imagei, $payment, $shipping, $condition, $feat, $paws, $grabber, $bold, $dutch, $qty, $silent, $relister, $buyit, $buyitnow, @bids) = map{sentenceCase($_)} <THEFILE>; if ($form{'REPOST'}) { $form{'REPOST'} =~ s/\W//g; if (-T "$config{'basepath'}$config{'closedir'}/$form{'REPOST'}.dat") { open THEFILE, "$config{'basepath'}$config{'closedir'}/$form{'REPOST'}.dat"; ($title, $reserve, $inc, $desc, $image, $imagea, $imageb, $imagec, $imaged, $imagee, $imagef, $imageg, $imageh, $imagei, $payment, $shipping, $condition, $feat, $paws, $grabber, $bold, $dutch, $qty, $silent, $relister, $buyit, $buyitnow, @bids) = map{sentenceCase($_)} <THEFILE>; close THEFILE; chomp($title, $reserve, $inc, $desc, $image, $imagea, $imageb, $imagec, $imaged, $imagee, $imagef, $imageg, $imageh, $imagei, $payment, $shipping, $condition, $feat, $paws, $grabber, $bold, $dutch, $qty, $silent, $relister, $buyit, $buyitnow, @bids) = map{sentenceCase($_)} <THEFILE>; $title =~ s/\"//g; # quotes cause problems for a text input field, However this does not seem to work. sub sentenceCase { my $input = shift; my $output = ""; $input =~ s/\b([^\.]+)/\u\L$1/g; return $input; } }} print <<"EOF"; <table width=95% cellspacing=0 cellpadding=0 border=0 bgcolor=$config{'colortablehead'}> <tr><td width="100%" align=center><font size=5 color=$config{'colorheadtext'}><b>Post Item For Bids</font></b></td></tr> </table> EOF print "<TABLE width=95% BORDER=0 CELLSPACING=0 CELLPADDING=0>"; print "<FORM ACTION=$ENV{'SCRIPT_NAME'} METHOD=POST>"; print "<INPUT TYPE=HIDDEN NAME=action VALUE=procnew>"; print "<tr><td align=center width=100% BGCOLOR=$config{'colortablebody'}><br></td></tr>"; print "</table>"; print "</tr></table>"; print "<TABLE width=95% BORDER=0 CELLSPACING=0 CELLPADDING=0>"; print "<tr>"; print "<td BGCOLOR=$config{'colortablebody'} width=38%><b>\ \;Select Category:</b></td>"; print "<td align=left BGCOLOR=$config{'colortablebody'} width=62%>"; print "<SELECT NAME=CATEGORY>"; print "<OPTION SELECTED>Select Category</OPTION>"; my $key; foreach $key (sort keys %searchcats) { @cat = split(/ - /,$searchcats{$key}); if ($cat[1] ne "") { print "<OPTION VALUE=$key>$searchcats{$key}</OPTION>\n" if ($searchcats{$key} ne " - "); }} print "</SELECT></TD></TR></table>"; print <<"EOF"; <br><table align="center" bgcolor="white" bordercolor="red" border="1" cellspacing="0" cellpadding="0" width=98%> <tr> <td align=center><TABLE align=center BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR><TD align=center VALIGN=TOP><font face="Verdana, Arial, Helvetica, sans-serif" color="#FF0000" size="3"> Please <u><b>Do Not Use</b></u> Special Characters, Html,<br><b>ALL CAPITALS</b>, or Excessive Spacing ! </font></TD></TR> </TABLE> <TABLE align=center BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR><TD align=center VALIGN=TOP>\ \;<B>Title/Item Name:</B></TD><TD><INPUT NAME=TITLE VALUE=\"$title\" TYPE=TEXT SIZE=50 MAXLENGTH=50 style="text-transform: Capitalize"></TD></TR> </table></td> </tr> </table><br> <table border="0" width=95% cellspacing="0" cellpadding="0" BGCOLOR=$config{'colortablebody'}> <tr><td width="100%" align="left"><b>Attention Grabber <font color="#FF0000">\$$config{'grabberfee'} Fee</font></b></td></tr> </table>
|