I'm really at wits end on this as I'm not having much success with locating a function or other options I have. I'm working on a message board for a website and I'm needing to check the length of the words that users put in.
For example, when someone puts in "yesssssssssssss!", I put together a small function that omits all of the s's as this is wreaking havoc on the layout of tables within the site. But I don't have a solution if someone types in "ssss sasdfjskldjfaskld;jfaskdf" as random ambiguous letters.
I know I can check the length of the entire string but don't know to check the words
within it.
strTemp="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed"
and I am searching the string for another string 'amet', for example. How would I go about getting my page to output the word I search for and say 10 chars to the left and 10 to the right? So, in this case, I'd like to be be able to search the string with any other string ['amet' for example] and have it output this:
how to capitalise all words in a string that are seperated by spaces. The string is variable and not the same every time hence I cant use the Ucase function as I wont know the exact position of the start of each word.
This all works, but the table width can only be 770 pixels. If the menu structure is going to be wider than 770 pixels it has got to be devided into 2 or more lines.Is it possible to determine the pixels word by word?Or is there another possibility?On Google I read it would be possible in java, php,Only I didn't find anything that refers to ASP.
I have problem with multi-language string values. I have an input box, which accepts max 75 chars. Value goes to SQL server table field VARCHAR (75). it was okay with english language but error comes when saving Arabic or any RTL language.
I checked the values by Response.write len(myRecievedString)
OutPut:
Lenght of String Containing 75 English chars: 75 Lenght of String Containing 75 Arabic chars: 525
i have a search form that will only search the whole string when searching a query. i would like to have the search string split into separate words so that each word could be used as part of a single query. is there a simple solution to my question ?
I currently have a program that crashes if the sessionid is longer than 9 digits. Is there a way to trim the length of the string that IIS kicks out and limit it to 9 digits, or if that can't be done, is there a function I can use to trim the 10 digit string down to 9 digits?
let's say that I want to highlight some words or even a square of a table in yellow...how would i go about doing that? What code would work to do what I need?
I'm having a problem in displaying a selected option from the drop down list in words. But after I selected an option, nothing is being displayed, I think the value can't be passed at all. Please let me know how to fix it.
<td align=center width=20%>Fruit: <select name=""FruitName"> <% " If not myRS.eof Then while not myRS.eof %> <option value="<%=myRS.fields("ID")%>"<%If FId = myRS.fields("ID") Then response.write "selected"%>><%=myRS.fields("FName")%></option> <% myRS.MoveNext wend %> </select>
<p>The fruit you have selected is <%=FruitName%></p>
I have a database field that is a memo type. I would like to be able to only display the first 50 words from the database. I would like for it to show ..... after about 50 words.
I am using <%=Content %>. How do I trim this field to show only 50 words and then ....?
I tried the following code: Function LengthTrim(input, length) If Len(input) > length Then Return Left(input, length) + "..." Else Return input End If End Function
then <%= LengthTrim(Content, 50) %>
But it would not work. I got the following error message:
Microsoft VBScript runtime error '800a01f4'Variable is undefined: 'Return' .
i am having trouble getting my REPLACE fn. to replace whole words only. basically, i'm running a 'spelling checker' fn. that uses the REPLACE fn. to find incorrect spellings and replace them. problem is, the fn. seems to replace all instances of a string, and not a whole word only as I intend it to be:
Code as follows:
StrInput = Request.Form("BKM_Search") StrInput = LCase(StrInput) 'convert all to lowercase StrInput = Trim(StrInput)'trim all empty space b4 & after string StrCorrect = Replace(a_StrWrong, a_StrRight,1,1,1)
Let's say I want to replace the word "sea" with "ZZZ" only:
Example input: "Sean has some neat sea shells" Example output: "ZZZn has some neat ZZZ shells"
I have to develop a spell checker from scratch using asp language. as i'm a newbie with asp, there are still a lot of things that i don't understand. How can I add new words to my list of dictionary sorted alpabetically?
Do i need to use the database for this function? Can anyone show me? or if anyone knows of any websites that i can refer to.
I have an asp page that uploads a text file, with SQL Statements inside. After I upload the file, I want to execute the statements and then delete the file from the server. The problem is: when I read the first Sql statement, it gives an error when I try to execute it I get a "Identifier that starts with 'INTO blah blah' is to long. Maximum length is 128. But when I response.write the variable it shows the whole string, all +-600 chars of it. So is this a DB Problem? (I'm using SQL Server 2000) And how would I change it, if it was?
I believe that it's possiblte to set the length of time that a visitor to a site can be inactive before their session time's out, but I don't know what the coding is or where it's placed. have never had to bother with this, but I've just started with a host, whose server seems to time-out my session after like 4 or 5 minutes
in my asp code i have a part that selects 10 products at random, and then displays in a right hand menu as links. however long titles tend to run over 2 lines, and dont look right clever. I was wondering if i can add a length to my sql for instance select * from products where prodname.length < 10 how do i do that, PS i am on mysql server
I think an url variable could be limited, maybe someone know the maximum length I can use ? (I try to send an html code with the get method, maybe some symbols could not be accepted in url).Is this length limited for a variable or for the url string ?
I have a webpage with a form and i am saving the webpage using name value pairs. So i can give the users a link which they can click on and the form will open up prepopulated.
The problem i am having is that these forms can get exteremely long (hence the prepopulation facility) e.g test.asp?name=value?name1=value1?name2=value2
is there any way to increase the url in a browser or if you know of any other way i can accomplish this id appreciate ure feedback more detail regarding the above: I am allowing useers to save their forms with the data, also save multiple versions of the form (same form with diff data).
I have a question about the Max Referer length. By default this is 256. I am not fully sure I understand this property. It this a header that is sent back to the Server by a client and is it part of the URL.
While testing our Secure IIS I ahd the error come up I increased the value to 1080 and the error did not repeat!. But through my search the Max Referer lenght is always 256. SO I am trying to get feel for what the Referer really is, is it part of the HTTP 1.1 protocol?
i have a webpage containing a textbox (textbox1) and a label(label1).As the user is typing into the textbox i want the label to show the amount of characters they have typed. How do i go about doing this?
I am passing data between ASP pages and use the Response.QueryString (I know that this is not the best method). Is there a limit or is this configurable?
wondering if its possible to have some kind of searched word highlight! IE. every thing it throws up in return of search it will highlight why it has brought it up! so if search "a" all "a" in return results would be highlighted.
is it possible (i heard u can replace) to filter out bad words using regexp? I'm using Replace() but it sucks without ALOT of extra code... but using regexp it seems better, with ignorecase, etc.
how can i count how many words have i written in a text area?Like taking an example ... i am writing in this textarea of microsoft usergroup. and say in total i have written 50 words .. how can find out this information?