Hi,
If someone enters High School in a text box i want to make it H.S.
If someone enters university in a textbox I want to make it Unv
I tried the replace function in javascript but i think i messed it up somewhere
Any idea
todd
Hi,
If someone enters High School in a text box i want to make it H.S.
If someone enters university in a textbox I want to make it Unv
I tried the replace function in javascript but i think i messed it up somewhere
Any idea
todd
Could you post your code?
And how are you calling the JS function?
for one, post your code. for two, what if they type in Univ ... or College or etc. well, hopefully you get what i'm getting at. why not use a drop down box so that they will always be what you want them to be.
Quote of the Month:
Leaders: Leaders are like eagles. We don't have either of them here.
Questions to Ponder:
Why do banks charge you a "non-sufficient funds fee" on money they already know you don't have?
iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69
Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it.
hi,
this is the code i have
Code:if (getinstnamemem.length > 0) { getinstnamemem=getinstnamemem.replace("High School", "H.S."); getinstnamemem=getinstnamemem.replace("University", "Unv"); }
but if someone enters university it doesnt change it to Unv
can someone tell me how i can make it happen
todd
There is really no good way to do what you are trying to do. The number of permutations are almost infinite, even if you upper or lower case the string prior to doing the replace:
High School
High School
High School
University
Univ.
Univ
are all different.
Wolffy
------------------------
Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.
Bookmarks