function ConvertToUpperCase()
{
var result;
var numaric = "sonia";
var Character = numaric.charAt(0);
result=Character.toUpperCase();
//In Result char is coming in UpperCase
//I want how to replace the charater at postion 0 in numaric with result
}
In my application (yes I know that it's asp) I need to automatically replace a character if it is found in the textbox Is there a way to do this. this is how it renders on the page
I am having trouble finding any examples to help me strip everything up to a certain character (the hypen) in a url. only know how to accomplish this using a literal only for one url at a time.And I am hoping to be left with the series of numbers on the end.
I have a HTML form which takes some values including a password field. I have a JS function to check and alert when a user enters some particular special characters(this is bcoz only these characters are not allowed in the back end of the html form, all the other special characters are allowed). following is the code for it.
function checklen() { var iChars = "`<>"; for (var i = 0; i < document.ipform.password.value.length; i++) {
[Code]...
now i want a feature which does'nt allow the user to enter an uppercase letter or a special character(only these are allowed~@#$%^&*()-_+|) as the the first character of the password field. Since i am newbie to JS, It would be a great help if some one can help me to sort out this..
i,m trying to make a map who show me as position A and a target adress as point B.I have made it so i can choose adress a and adress b from a dropdown but i want to automaticly load my position as possition A then choose position B from a dropdownlist. How can i do this ?
I'm new to javascript and am not sure why this works in firefox and not chrome. I am trying to create a script that keeps an object fixed horizontally while bing positioned absolute vertically. if I replace the toPP variable in document.getElementById('fire').style.top = toPP; with say '50px' it will move the element down 50 pxs, but how I have it currently it doesn't do anything in chrome
<script type="text/javascript" > window.onscroll = function() { if( window.XMLHttpRequest ) { var x = 0 -document.documentElement.scrollTop; var toP = String(x); var toPP = toP + "px";
#navigation li is the parent element, which is positioned relative.The ul element above that is also position relative. I previously tested a click function and was able to confirm I was getting the correct position back, so now I just need to set the CSS property correctly for all of those links.The reason I want to do this is I have a set of links that appear over a photo of a city skyline. When you hover over those items, I want them to be given a background image that is a blurred and lightened version of the same photo so it needs to line up (sort of like the tabs are made of frosted glass).
<script type="text/javascript"> var str="Welcome to Microsoft! Microsoft Microsoft"; var stringToBeFound = 'Microsoft' var ReplaceString = 'site' document.write(str.replace(stringToBeFound , ReplaceString )); </script>
My problem is im trying to use string.replace that is not case sensitive and replace every string found. I could use regular expression with it but my stringToBeFound is a dynamic variable im getting it from my database
i am trying to make an online graphing calculator with javascript. dont ask how because i dont know. but there is an annoying error in a do...while loop. although it should break out of the loop when the |'s (absolute value signs) are replaced with Math.abs( and ). here is the code.
I have a HTML file that has a lot of content. In it I have a <div id="d1">somecontent</div> block. Would it be possible for me to know the position of this d1 (absolute or relative) displayed on the page / window if not setting it first ?
Does anyone know the escape character for & and # like in : Update GDO_INFO_ER set V_COMMENTAIRE='B&A' where V_USERMODIFICATION='bilal123' or Update GDO_INFO_ER set V_COMMENTAIRE='B#A' where V_USERMODIFICATION='bilal123' I would like to insert & and # literally in the table.
But when I mouse-over the link, the %27 shows in the status bar as a ' and when I click on it, I get a JS error because of the extraneous '. The +s are not being decoded - why is this one character, and is there a way to prevent it?
I have this string: "60 105 109 103 32 115 114 99 61 34 101 108 111 46 106 112 103 34 62", and I'd like to convert it to the characters. I've used the split method to separate it but I don't know how to transform each number in the character. Could you hel me?
I had a difficult time figuring out how to get or test the last character of a string with javascript.
I found plenty of removing the last character, but not for just checking what the last character of a string is using javascript.
// create string var str = new String("No Periods Allowed."); // alternatively get string from field: // var str = document.getElementById('textbox').value;
[Code]....
Well, finding that easily on a search would have saved me some time.
i have a little problem with the follwoing JS, when i count characters for Input type text the reult is ok but when i am using textArea it says 'NAN' here is my code,
--------------------------------------- <script language = "Javascript">
function taLimit() { var taObj=event.srcElement; if (taObj.value.length==taObj.maxLength*1) return false; }
function taCount( taObj ) { var lbObj=document.getElementById("myC"); if (taObj.value.length>(taObj.maxLength*1)) { taObj.value=taObj.value.substring(0,(taObj.maxLength*1)) }; var count; count = taObj.maxLength-taObj.value.length; lbObj.innerHTML=parseInt(count);
I was wondering if there was any easy way to do the following in javascript:
I have two form fields, firstname and last name, as the user enters their information into a form I want to be able to show them what their username is going to be.
While they enter the information into the fields I was hoping to have it generate the username as the type.
I need to take the first letter of their first name (the first letter in the firstname field) and the entire lastname to combine it into a username. Except if there are spaces or any other characters such as dashes apostrophes they must be removed.
The follwing function is in an onkeypress event for some textboxes. How can I cancel the keystroke? or more importantly it's output. This function does what I want it to do, but it actually writes a space in the textbox. I wanted to escape out of writing the character. Especially if I change it to another keyCode besides space bar. Any ideas?
function setEfforts(ctrl){ if(event.shiftKey && event.keyCode == 32) { var row = ctrl.parentNode.parentNode; var inputs = row.getElementsByTagName('input'); var textboxes = new Array(); for(var x = 0; x < inputs.length; x++) if(inputs[x].type == 'text'){textboxes.push(inputs[x]);}
for(var y = 0; y < textboxes.length; y++) textboxes[y].value = ctrl.value; } return false;
I am struggling to find definitive information on how IE 5.5, 6 and 7 handle character input (I am happy with the display of text).
I have two main questions:
1. Does IE automaticall convert text input in HTML forms from the native character set (e.g. SJIS, 8859-1 etc) to UTF-8 prior to sending the input back to the server?
2. Does IE Javascript do the same? So if I write a Javascript function that compares a UTF-8 string to a string that a user has inputted into a text box, will IE convert the user's string into UTF-8 before doing the comparison?
I think that the answer to question 1 is probably "YES", but I cannot find any information on question 2!
I have had this function work perfectly in IE and am trying to get it to work in Firefox. I have seen plenty of questions and answers on the web for how to get and check the key pressed but nothing about setting or changing it. I only want uppercase characters in this case. If the key is a lowercase, it needs to be changed to an uppercase character. IE lets you use keyCode to change the character code. How do I do the equivalent in Firefox?