I have a textbox ( I am using asp.net ). I want to use that textarea as rich text box. The text in textarea is submitted to database and then displayed. So, I can use <b><u> tags, but I want to use smileys too. I need a simple code for it.Whatever text is written inside the textarea is first read and when a group of specific character like
Code:
" :) ;) x-("
are found, that characters should be colored to red . So, a
Code:
:)
will appear as
Code:
:)
.
This logic is simple but I am new to javascript programming, it cant implement it.
I would like to create a program which converts some letters into different ones.
1) I want 2 text areas (input and output) + "convert" button
2) if I type in the input area the letters "ea" I would like it to be converted into "a", so that If I type "cambrea" and press "submit" the output text will have "cambra".
3) if I type "e " which is (e+space) I want it to be converted into " " which is "space" example: if I type the word "spine " it should be converted into "spin , note that there is a space after "spin ".
4) If I type any vowel before "o" it should render "o", example: gambuo becomes gambo. would this be possible? I'm not very familiar with Javascript even though I can modify it.
I am having problems with the code below (obviously) coming up with illegal character for various characters within the field name which is: S_Gift Finder1_0
I have tried various ways of escaping the characters but to no avail.
I am unable to change the name of the field as it it comes from an external off-the-shelf package. Code ....
I have character counter for textarea wich counting the characters. Special character needs same place as two normal characters because of 16-bit encoding.
Counter is counting -2 when special character is added like some language specific char.
var gstAmount = (exGst * (1 / gst)); var gstInc = (exGst + gstAmount)
alert(gstAmount); alert(gstInc);
}
now, the exGst parameter comes from an document.getElemenetById('txtExGst').value in an onclick event.
the problem is this. if 400 is entered at exGst, the gstAmount spits out 40, as it should, but the gstInc spits out 40040...so its treating it like a string rather than a number...
Is it possible to convert hex to an image with Javascript? I want to pass an image through a web service as hex, and need to know if I can extract that on the client side and display it as an image..
For example, I have <span id="convert">1</span> somewhere on my page. Notice the "1", I want to covert "1" into let's say "John" every time the "1" is within a span tag with "convert" as the id. I also want "2" to be converted to "Pete". And "3" to be converted to "Bob".
This javascript creates a table that has a header and side column that do not move while scrolling through the table. I need to convert this to vb script. Can anybody help, or do you have code in vb (asp) that would do the same thing?
I use the following script in order to show/hide a section, and at the same time to change a companion .gif with another:
function doExpand(paraNum,arrowNum){ if (paraNum.style.display=="none"){paraNum.style.display="";arrowNum.src="../../images/arrOn.gif"} else {paraNum.style.display="none";arrowNum.src="../../images/arrOff.gif"} }
and then in the body: <div id="reltpc"><a href="javascript:;" onClick="doExpand(xplan1,ico1)"><img id="ico1" src="../../images/arrOff.gif" alt="" width="10" height="9" border="0"> Show Info</a></div> <div id="xplan" style="display:none" onClick="doExpand(xplan,ico1)"> <p>text here</p> <p>some more text here</p> </div>
Furthermore, two more scripts are used in order to show/hide a section without the image:
function doSection (secNum){ if (secNum.style.display=="none"){secNum.style.display="block"} else{secNum.style.display="none"} }
function noSection (secNum){ if (secNum.style.display=="block"){secNum.style.display="none"} }
and then in the body: <div id="more"><a href="javascript:;" onClick="doSection(dtails1)">More Info</a></div> <div id="dtails1" style="display:none" onClick="noSection(dtails1)"> <p>text here</p> <p>some more text here</p> </div>
All three of them are working good in IE and Ffox, however the second claims to use "gelElementById" instead.
Well, how could it be done? Would you help me please, to get that conversion?
I have some pages with this VBScript code, which obviously does not work in Firefox. How can I convert this to Javascript in order for my web page to work in Firefox ? It basically fills a drop down with a list of dates that a user can select. Code:
in my script file , i need call a method of a atl com module(implemented in vc++), which returan an safearray. i don't know how to convert it into array in jscript. i have tried serveral ways to get each item but failed at last.
I can't seem to get this color conversion from hex to rgb to work:
/* note: hexStr should be #rrggbb */ var hexStr = 'bebebe'; var hex = parseInt(hexStr.substring(1), 16); var rcolor = (hex & 0xff0000) >> 16; var gcolor = (hex & 0x00ff00) >> 8; var bcolor = hex & 0x0000ff; return [rcolor]; return [gcolor]; return [bcolor];
Lines 2-10 are a script I found. Looking to write the indiv. rgb values into another line. FYI this whole script draws a multiple text shadows behind text and rotates it.
I've found some routines on the 'net that will convert 7-bit ascii to hex, but I'm interested in converting all valid javascript characters (16-bit unicode) into hex. and with javascript.
I have a string containing whitespaces, for example, "Michael Douglasemail.com". In Javascript, how can I replace the whitespace with underscore? "Michael_Douglasemail.com"