User Profile
Collapse
-
I found a stupid mistake with my input, the last function I wrote works correctly although I will need to add id attributes to several pages. If anyone has additional input to get the original function to work that would be appreciated. -
I have also tried this method:
If I set IDs on the options like so:
[html]<option id="CR - Copy Recorded">CR - Copy Recorded</option>[/html]
This works:
Code:function setSelectValue() { var curOption = document.getElementById("CR - Copy Recorded"); curOption.selected = true; }
...Leave a comment:
-
Hmm, that did not seem to work either.
I also tried using value after adding the value attributes to the options.
[HTML]<option value="CR - Copy Recorded">CR - Copy Recorded</option>[/HTML]
That did not work either....Leave a comment:
-
Set select box option to be selected based upon a variable.
I need to set an option from a select box to be selected based upon a value I am pulling from a database.
I cannot alter the code of the select box in this case, so I must use javascript to change it after the select box has loaded. There are several pages, some with several select boxes, that need this function. I would like one javascript function that will take take two variables (the form element and a value) and then set the... -
Replaced window.onkeyup with the following code to work in IE.
Code:window.onload = function() { document.getElementById('userans0').onkeyup = calcNow; document.getElementById('userans1').onkeyup = calcNow; document.getElementById('userans2').onkeyup = calcNow; }
Leave a comment:
-
Thanks that worked.
I find that most of my javascript errors are syntax errors that I overlook :\...Leave a comment:
-
This does not appear to work either. Below is my updated code. I also tried putting an alert box in calcNow for testing, and it did not show up. Thanks.
Code:window.onkeyup=calcNow; function calcNow { calcIT(document.quizform.userans0.value, document.quizform.userans1.value, document.quizform.userans2.value); } function calcIT(v,a,b) { var total, v2, a2, b2;
Leave a comment:
-
Using document.onkeyup to calculate a field value
I have a form with 4 text input fields. The last one is the total of the previous three fields and should automatically calculate this value when a user enters data into any of the first 3.
Normally I would put an onkeyup="" event on the input elements and have that call the function. However, this form is automatically generated based upon information in an XML file. I can add some HTML and Javascript to the page via the...
No activity results to display
Show More
Leave a comment: