![]() |
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Hi, I have a textbox so if someone types Cars i want to abr it to CR, If someone types financial i want to FCR so here is my code Code: var getabrdata=document.frm1.abrfield.value;
getabrdata=getabrdata.replace("Cars", "CR");
getabrdata=getabrdata.replace("financial", "FCR"); todd |
| Sponsored Links |
| ||||
| Please be more descriptive when you say, "it doesn't work". Anyway, have a look at W3Schools here: JavaScript replace() Method There are a few things you need to look into:
__________________ jmurrayhead Did I help you out? Make me popular by clicking the icon!If you found a post helpful, please click the button in the lower right-hand corner of the post.Powered by ASP.Net |
| |||
| what i meant was i have the code on keyup event so when i type in textbox and i type Cars it doesnt change to CR in my span tag when i display what was typed in the textbox i had tried it with commas and without commas before i posted here but it didnt work |
| |||
| hi, I have it like this Code: var getabrdata=document.frm1.abrfield.value;
getabrdata=getabrdata.replace("Cars", "CR");
getabrdata=getabrdata.replace("financial", "FCR");
document.getElementById('display').innerHTML=getabrdata; todd |
![]() |
|
| Bookmarks |
| Tags |
| event, function, javascript, keyup, replace |
| Thread Tools | |
| Display Modes | |
| |
| Sponsored Links |
| ASP.NET Resource Index a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer. Free Web Directory Including Chats and Forums Resources, Offer automatic, instant and free directory submissions. | URLZ Web Directory URLZ Web Directory Free Web Directory - Add Your Link The Little Web Directory | Free Web Directory Pegasus free web directory is a free directory organised by categories. |