![]() |
Lowercase Output
Hi,
For my JavaScript at http://www.payitforwardfriends.com/converter.html I want it so that when you press calculate the result is all in lower-case. In other words, I want it to write the substance in lower-case in the result but not in the list of options. How do I do this? Thanks! |
|
Thanks for your reply but it doesn't seem to work.
|
Erm
Quote:
Quote:
LT |
so you're saying that at http://www.payitforwardfriends.com/converter.html it works right now?
the result text is all in lowercase? for me it's showing up in uppercase (the first letters of each substance word) |
What do you mean?
|
Quote:
Are you using the error console? |
You are setting
Code:
var substancetext = "";Code:
if (substancetext != "") { |
Quote:
|
Quote:
Code:
if (substancetext != ""){Code:
if (substancetext != ""){Aren't we dealing with result and not substancetext? |
You're code is confusing...
If you want 'result' to be the display then you should try... Code:
result = result.toLowerCase();Code:
document.getElementById('result').value = result.toLowerCase(); |
I'm confused too. Let me try to explain this more clearly:
Alright see the textbox at the bottom that says result? When you select a substance, select a from this and a to this, and press calculate that box is filled. The substances in the box are capitalized (the first letter of each word). I would like them to be lowercase. Where do I place the necessary code? |
Did you write the code, copy it or have someone else do it for you?
What does this mean to do? Code:
var result; |
I am editing the code someone else wrote and making major changes.
Originally, there was a line of text underneath the "result" that was substancetext. When I got rid of it, for some reason the conversion stopped to work. That's why that line is there. I was told to put the lowercase code there to fix it, and tried it and forgot to remove it. There is no reason why that would work. Substance text is not visible to the user, only result. I will remove it now. |
Still rather confusing but start from here for further discussions ...
Code:
<html> |
| All times are GMT +1. The time now is 02:33 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.