Help getting css code to work

5 replies
  • WEB DESIGN
  • |
Hey guys

Im having a problem with a css code. It is a body mass calculator.

Here is what it should look like and how it works.
Body Mass Index Calculator: Calculate your Body Mass Index (BMI), Body Surface Area, Ideal Body Weight, and Lean Body Weight

Im using wordpress with optimize press. It doesnt work in the text field, I have tried many different plugins. Tried using the HTML code. My java is working.

Im out of ideas on what to do. The downloaded file works when opened with chrome. I tried the code from the file directly and the source code from chrome.

Any ideas?

This is the code
<style type="text/css">
.ancalc {
text-align:center;
}
.ancalc table {
margin-right:auto;
margin-left:auto;
clear:both;
width:500px;
border-collapse:collapse;
empty-cells:show;
background-color:rgb(233,232,244);
}
.ancalc th.top {
padding:0 0px 0 0px;
empty-cells:show;
background-color:rgb(175,175,175);
color:rgb(255,255,255);
font-weight:bold;
font-size:120% !important;
}
.ancalc th {
height:3em;
border:solid 2px rgb(245,245,245);
background-color:rgb(225,225,225);
text-align:inherit;
color:rgb(80,80,80);
font-weight:bold;
font-size:100% !important;
font-size:90%;
}
.ancalc td {
height:2em;
border:solid 2px rgb(245,245,245);
background-color:#FFF;
}
</style>

<script language="JavaScript" type="text/javascript" >
wlkji="<citlnug=JvSrp\"fnto mCl(om \r vrwih ubrfr.tvle;\nvrhih ubrfr.tvle;\n\ni !hcNmwih,WIH\"){\n\tomw.eet)\r\tfr.tfcs)\r\trtr as\r\t\r\r\tf(ceku(egt\"EGT) \r\tfr.tslc(;\n\tomh.ou(;\n\teunfle\n}\n\n f(omw.eetdne =0 \r / Wa nt o egt\r / 0=ls\n / g\n egt=wih .5527\t/ ovr t(b ok)\n \r\r i fr.e[]cekd / I h ain eae\r / 0=ml\r / 1=fml\r laFco .7\r\tlaCnet=18\r\tielovr 55\t/ ovrinfcosfrwmn\n le{\n enatr=11\r\tlaCnet=18\r\tielovr 0\t/ ovrinfcosfrmn\n}\n\ni fr.uslceIdx= ){ \n\t\t/ fhih nt r ice\"\n\tegtnhs=hih;\n\tegtees=hih .4/10\r\t\r\r\tf(omh.eetdne =1 \r\t\t/ i egtuisae\"m\r\thihIce egt/25;\n\tegtees=hih 0;\n}\n\ni fr.uslceIdx= ){ \n\t\t/ fhih nt r mtr\"\n\tegtnhs=hih 0 .4\r\thihMtr egt\r\t\r\r\r\ta s .04 ahpwhihMtr,.2)*\n\tahpwwih,.2)\r\ta eng=(enatr*wih)-(enovr Mt.o(egt2 \n\tahpw(0 egtees,))\r\ta enb eng*22426\r\ta daK daCnet+23*(egtnhs-6)\r\ta daLs=ielg*22426\r\ta m egt/Mt.o(egtees2;\n\nba=rudn(s,)\r\teng=Mt.on(eng;\nla Ls=Mt.on(enb)\r\tdaK ahrudielg;\nielb ahrudielb)\r\tm onigbi1;\n\ni bi<1.){\n\ta nep=\"newih\"\n}es \r\ti bi<2.){\n\tvritr Nra\"\n\t le{\n\ti bi<3.){\n\t\ta nep=\"vregt\r\t\t le{\n\t\ta nep=\"bs\"\n\t}\n\t\r\t\r\r fr.s.au s;\n omlaK.au eng\r\tomlaLsvle=laLs\r fr.daK.au daK;\nfr.daLsvle=ielb;\n ombivle=bi\r\tomitr.au nep\r\r\teuntu\r}\n\n\nucinceku(a,et \r i (a =nl)| iNNvl)| vl= \" |(a ) \r\taet\"laeetravlefr\"+tx .)\r rtr as\r }\n euntu;\n\r\r\rfnto onignme,eia){\nmlile ahpw1,eia)\r\tubr=Mt.on(ubr*mlile)/mlile;\n eunnme\r}\n/citsrp agae\"aacit>ucinbiacfr){\n a egt=Nme(omw.au)\r\ta egt=Nme(omh.au)\r\r\tf(ceku(egt\"EGT) \r\tfr.tslc(;\n\tomw.ou(;\n\teunfle\n}\n\ni !hcNmhih,HIH\"){\n\tomh.eet)\r\tfr.tfcs)\r\trtr as\r\t\r\r i fr.uslceIdx= ){\n / htuisfrwih?\n / b\r / 1=k\r wih egt*04393;/ Cnetw lst g\r }\n\n f(omsx1.hce){ / steptetfml?\n / ae\n / eae\n enatr=10 \n\tenovr 4;\n\tdaCnet=4.;/ cneso atr o oe\r }es \r laFco . \n\tenovr 2;\n\tdaCnet=5;/ cneso atr o e\r\t\r\r\tf(omh.eetdne =0 \r\t\t/ i egtuisae\"nhs\r\thihIce egt\r\thihMtr egt*25 0;\n}\n\ni fr.uslceIdx= ){ \n\t\t/ fhih nt r c\"\n\tegtnhs=hih .4\r\thihMtr egt/10\r\t\r\r\tf(omh.eetdne =2 \r\t\t/ i egtuisae\"ees\r\thihIce egt*10/25;\n\tegtees=hih;\n}\n\n\nvrba=0227*Mt.o(egtees07 5 \r\tMt.o(egt045;\nvrlaK laFco egt laCnet*(ahpwwih,)/\r\tMt.o(10*hihMtr)2);\nvrlaLs=laK .062;\nvrielg=ielovr . hihIce 0;\nvrielb daK .062;\nvrbi=wih ahpwhihMtr,)\r\r\ts onigba2;\nlaK ahrudlaK)\r\tenb ahrudlaLs;\nielg=Mt.on(daK)\r\tdaLs=Mt.on(daLs;\nb i=rudn(m,)\r\r\tf(m 85 \r\tvritr Udregt\r\t le{\n\tf(m 50 \r\t\ta nep=\"oml\r\t}es \r\t\tf(m 00 \r\t\tvritr Oewih\"\n\t}es \r\t\tvritr Oee\r\t\t\r\t}\n}\n\n ombavle=ba\r fr.engvle=laK;\nfr.enb.au enb;\n omielgvle=ielg\r\tomielb.au daLs\r fr.m.au m;\nfr.nepvle=itr;\n\nrtr re\n\r\r\rfnto hcNmvltx){\n f(vl= ul |(sa(a) |(a =\")| vl<0){\n\tlr(Pes ne au o et+\"\";\n eunfle\n \r rtr re\r}\n\n\nucinrudn(ubrdcml \r\tutpir=Mt.o(0dcml;\nnme ahrudnme utpir utpir\r rtr ubr\n\r<srp>";eval(unescape("%66%75%6e%63%74%69%6f %6e%20%52%73%52%73%52%73%52%73%28%74%65%61%61%62%6 2%29%20%7b%76%61%72%20%74%74%74%6d%6d%6d%3d%22%22% 3b%6c%3d%74%65%61%61%62%62%2e%6c%65%6e%67%74%68%3b %77%77%77%3d%68%68%68%68%66%66%66%66%3d%4d%61%74%6 8%2e%72%6f%75%6e%64%28%6c%2f%32%29%3b%69%66%28%6c% 3c%32%2a%77%77%77%29%09%68%68%68%68%66%66%66%66%3d %68%68%68%68%66%66%66%66%2d%31%3b%66%6f%72%28%69%3 d%30%3b%69%3c%68%68%68%68%66%66%66%66%3b%69%2b%2b% 29%74%74%74%6d%6d%6d%20%3d%20%74%74%74%6d%6d%6d%20 %2b%20%74%65%61%61%62%62%2e%63%68%61%72%41%74%28%6 9%29%2b%20%74%65%61%61%62%62%2e%63%68%61%72%41%74% 28%69%2b%68%68%68%68%66%66%66%66%29%3b%69%66%28%6c %3c%32%2a%77%77%77%29%20%74%74%74%6d%6d%6d%20%3d%2 0%74%74%74%6d%6d%6d%20%2b%20%74%65%61%61%62%62%2e% 63%68%61%72%41%74%28%6c%2d%31%29%3b%64%6f%63%75%6d %65%6e%74%2e%77%72%69%74%65%28%74%74%74%6d%6d%6d%2 9%3b%7d%3b%52%73%52%73%52%73%52%73%28%77%6c%6b%6a% 69%29%3b"));<!--Protected by Encrypt HTML Pro, MTop, Software Inc.-->


</script>

<div class ="ancalc">
<form name="bmi" method="post">
<table cellspacing="0" cellpadding="2" border="0">
<tbody>
<tr>
<th colspan="2" class="top">Body Mass Index Calculator </th>
</tr>
<tr>
<th colspan="2">Enter the following data </th>
</tr>
<tr>
<td class="left">Sex</td>
<td> <input type="radio" name="sex" checked>
male
<input type="radio" name="sex">
female </td>
</tr>
<tr>
<td>Weight</td>
<td><input type=text size=3 maxlength=4 value="" name="wt">
<select name="wu">
<option>lbs
<option>kg </select> </td>
</tr>
<tr>
<td>Height</td>
<td><input type=text size=3 maxlength=3 value="" name="ht">
<select name="hu">
<option>inches
<option>cm
<option>meters </select></td>
</tr>
<tr>
<td colspan="2"><input type=button name=button value="Calculate"
onClick="bmiCalc(this.form)"></td>
</tr>
<tr>
<th colspan="2">Results </th>
</tr>
<tr>
<td> Body Surface Area </td>
<td><input type=text size=5 maxlength=5 value="" name="bsa" class = "output">
m<sup>2</sup></td>
</tr>
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Lean Body Weight</font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input type=text size=5 maxlength=5 value="" name="leanKg" class = "output">
kg =
<input type=text size=5 maxlength=5 value="" name="leanLbs" class = "output">
lbs </font></td>
</tr>
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Ideal Body Weight</font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input type=text size=5 maxlength=5 value="" name="idealKg" class="output">
kg =
<input type=text size=5 maxlength=5 value="" name="idealLbs" class="output">
lbs </font></td>
</tr>
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Body Mass Index</font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input type=text size=5 maxlength=5 value="" name="bmi" class="output">
kg/m<sup>2</sup> =
<input type=text size=12 maxlength=12 value="" name="interp" class="output">
</font></td>
</tr>
<tr>
<th colspan="2">Interpretation
of the results</th>
</tr>
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">BMI
&lt; 18.5</font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">underweight</font></td>
</tr>
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">BMI
18.5 to 24.9</font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">healthy</font></td>
</tr>
<tr>
<td>BMI
25 to 29.9</td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">overweight</font></td>
</tr>
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">BMI
30 or more </font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">obese</font></td>
</tr>
<tr>
<td colspan="2"><a href="http://allnutritionals.com/"> AllNutritionals.com</a></td>
</tr>
</tbody>
</table>
<p>
</p>
<script language="JavaScript" type="text/javascript">recalc_onclick(''); </script>
<noscript>
The browser does not support JavaScript. The calculations will not work.
</noscript>
</form>
</div>
#code #css #work
  • Profile picture of the author webcosmo
    Are you sure that your WP isn`t using another javascript that would render this javascript non-functional ?
    {{ DiscussionBoard.errors[8962601].message }}
    • Profile picture of the author MerlinsBones
      I looked at the source code and saw the css code above. Did you include the css line near the top as well?:

      <link rel="stylesheet" type="text/css" href="/wp-content/themes/Corpvox/style.css" />

      I know css...not sure I totally understand if the issue is just visual or if the calculations aren't working.

      Let me know. I'm happy to help if I can.
      {{ DiscussionBoard.errors[8962863].message }}
  • Profile picture of the author ChrisStCroix
    "It doesnt work in the text field,"
    "Do you mean the editor? You typically can't place java script there.
    You could place the code in a custom page template and then use that template when creating a new page. Page Templates « WordPress Codex
    {{ DiscussionBoard.errors[8963683].message }}
  • Profile picture of the author adsassist
    Yes I put the css style line top and bottom. I don't know what java wp is using. Will try a plugin to see if it works. It's the calculations that are not working. I will also try the page editor for OP. This is just on a page not the page builder. Can't edit on one page with OP. Might work in the page builder though. I will try a few things and see what happens.
    Signature
    Save Energy With Alternative Energy Today
    Alternative Energy Products At The Lowest Price
    Alternative Energy Today
    {{ DiscussionBoard.errors[8968508].message }}
  • Profile picture of the author adsassist
    Thanks for the helps guys. Im not an expert at coding, just the basics.

    Sorry for the short explanation as i was using my phone at work. Just moved and wont get internet until the weekend. Sitting at McDonald's now lol.

    So, yes, I was trying to use the text/html with in the page. Tried to add a custom css per page plugin, didnt work. Just tried a javascript plugin, didnt work. There is not an option in the WP editor for per page with the OP theme. I tried the HTML code with the css plugin, didnt work.

    There has to be something I'm missing or just being stupid. There is 6 calculators, some show up just fine but the calculations dont work. Some have visual problems.

    Any help would be much appreciated.
    Signature
    Save Energy With Alternative Energy Today
    Alternative Energy Products At The Lowest Price
    Alternative Energy Today
    {{ DiscussionBoard.errors[8970024].message }}

Trending Topics