Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. fskipper

    Validate form fields for specific values ( not a range)

    DOH! Good call. Since I have you on the line... What can I add to *this* code to allow for null values? If the user accidentally clicks into one of these fields, the alert pops up because the onbBlur event says there must be a value. I have to allow nulls because I have another script that...
  2. fskipper

    Validate form fields for specific values ( not a range)

    I am trying to write a script to make sure that the user enters specific values ( 0.5,1,3,5, or 10) or else get an alert box. I have a script for another field that validates on a range, but I can't seem to modify it to work for *specific* values. Below is the range script, which works fine for...
  3. fskipper

    Average form values using only # of fields with data entered

    Got It!!!! Thanks! I changed the intital value to null and it works. I appreciate the help.
  4. fskipper

    Average form values using only # of fields with data entered

    OH, BTW. I have the intial values of the Sev fields set to '0'.
  5. fskipper

    Average form values using only # of fields with data entered

    Sweet. Thanks. I should have noticed that! At least I am finally getting ananswer. Now I actually get an answer in the sevavg field, but no matter how many sev's are entered it divides by 15 ( the max number of sev's).
  6. fskipper

    Average form values using only # of fields with data entered

    Thanks for the tip. I can see your point (function names). I renamed the function 'severityAverage()". Here's what happens: On the form the 15 "sev" values are actually entered into the forms by another Javascript. There are three form fields per Sev field. A calculation is run that adds two of...
  7. fskipper

    Average form values using only # of fields with data entered

    I removed the brace and tried it, then the closing brace (I think I truncated one closer above) still no-go. The code looks like it should work.: function sevavg(){ numVals = 0; ttlVal = 0; for (x=1; x<=15; x++){ if (x=1){ if (!isNaN(parseInt(document.Form.Sev.value))){...
  8. fskipper

    Average form values using only # of fields with data entered

    I tried the code that mwolf00 sent. I modified it a bit to fix some minor syntax problems. When I call the fucntion the browser freezes like an endless loop has been created. Can you see any errors here? function sevavg(){ numVals = 0; ttlVal = 0; for (x=1; x<=15; x++){ if...
  9. fskipper

    Average form values using only # of fields with data entered

    Hi. I am trying to write a function that will take 15 form fields, sum the values and divide by all the non-zero values. For example: if 12 values aare entered I want the sum to be divided by 12 for the average. Here's my cluncky code: function sevavg() { Sev = eval...

Part and Inventory Search

Back
Top