2 minor adjustments to code

When the combobox is changed put the selected combo text into this label:
<h3 id="Result">Select Pitch</h3>
Example:
<h3 text is: Select Pitch
user selects 8/12 pitch from the combobox
<h3 text now says 8/12 pitch
The reset button does nothing
its supposed to run the function:  clearFields
The code to run the function:
<input type="button" value="Reset" onClick="clearFields()">
The page :
http://roofgenius.com/test7.asp
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
For some reason, Firefox says that 'clearFields' is undefined.  I can see it in the "View Source" but I don't know why it's not working.
0
isnoend2001Author Commented:
Thanks Dave it was working yesterday and it just stopped
0
isnoend2001Author Commented:
I am going to try moving the clearFields into the body
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

isnoend2001Author Commented:
For some reason that worked
http://roofgenius.com/test8.asp
0
Dave BaldwinFixer of ProblemsCommented:
You still have a minor problem on Line 75 with 'Int' according to Firefox.
0
isnoend2001Author Commented:
This line:
inVal=inVal==Int(inVal)?Int(inVal):inVal;
what could that be ?
0
Dave BaldwinFixer of ProblemsCommented:
It says 'Int' is invalid.  'Int' is not a keyword in javascript so it's trying to find it as a variable.
0
isnoend2001Author Commented:
found this:
Int

Definition: At one stage it was planned that specific data types would be introduced into the Javascript language. int is one the data types that would have been able to be explicitly defined. To allow for this int was a reserved word. The plan to allow specific data types in Javascript no longer exists and int is therefore no longer on the reserved word list in the latest standards. Since many people still use earlier browsers where this was defined as a reserved word you should avoid using it.

I will post another question on how to fix it
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I know I didn't put that there.  What is it doing? or what did you ask to be done?

This function shouldn't be in the body
 // THIS FUNCTION WILL CLEAR OUT ALL OF THE FIELDS.  WE RUN THIS WHEN THERE IS AN ERROR
     function clearFields() {  
         $('#in').val('');
         $('#Multiplier').text('');
         $('#FeetAdded').text('');
         $('#Total').text('');
         $('#TotalSqs').text('');
     }

Open in new window

If it is only working there, that means something else is wrong.  Kind of like taking a pain pill when you have a deep wound in your arm.   The pain pill may stop the pain, but it does not fix the problem of needing stitches.

You can put that function where I have my comment.
 // THIS FUNCTION WILL RUN ALL OF OUR CALCULATIONS
     function calc(roofAreaVal) {
          // DO ALL OF OUR MATH
         InPutFeet = parseInt($('#in').val(), 10); //InPutFeet = Users input into textbox
         Multipler = parseFloat(roofAreaVal).toFixed(2); //Multipler = ComboBox selected value
         FeetToAdd = (parseInt(InPutFeet, 10) * parseFloat(Multipler)).toFixed(2); //FeetToAdd = InPutFeet * Multipler
         TotalFeet = parseInt(InPutFeet, 10) + parseFloat(FeetToAdd); //TotalFeet = InPutFeet + FeetToAdd		
         TotalSquares = TotalFeet / 100; //TotalSquares = TotalFeet / 100
       TotalSquares = parseFloat(TotalSquares).toFixed(2);
          // UPDATE OUR FIELDS
         $('#Multiplier').text(Multipler);
         $('#FeetAdded').text(FeetToAdd);
         $('#Total').text(TotalFeet);
         $('#TotalSqs').text(TotalSquares);
     }
// ************** add clearFields() function here ************

 });
 </script>

Open in new window



Not directly related, but you should keep your css above your js.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isnoend2001Author Commented:
Thanks padas
Not directly related, but you should keep your css above your js.
Did not realize that.
Was told this line was giving error:
inVal=inVal==Int(inVal)?Int(inVal):inVal;
EE coder said firefox was reporting error on int
Don't how he used firefox to see errors
So i changed it to:
inVal=inVal==Math.round(inVal)?Math.round(inVal):inVal;//changed
The change wll probably allow the function clearfields to be moved back to the head
I am assuming that java script it bails and does not read anything further
The page is getting there, glad you guys are here
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.