|
u have to create a event handler and then create function through javascript..
|
|
|
|
|
Hi all!!!
I have a simple task to replace the selected string with "<tag>SelectedString"
where tag is the value of selected item in list box.if i replace strings and show in alert it does weel but when i want to replce the text of editor in same way it did not replace. Below is the code im running......
function show(tagselection)
{
alert(tagselection);
var selection = getSelectedHTML();
var combine = "<"+tagselection+">"+selection+"</"+tagselection+">";
alert(combine);
editor1.value = editor1.value.replace(selection,combine);
alert(editor1.value);
//alert(editor1.
}
var editor1=document.getElementById('<%= Editor1.ClientID %>');
function getSelectedHTML(){
// get the active editor window
var editwin = editor1.GetWindow();
// get the active editor document
var editdoc = editor1.GetDocument();
var rng=null,html="";
if (document.selection && document.selection.createRange){
rng=editdoc.selection.createRange();
html=rng.htmlText||"";
}else if (window.getSelection){
rng=editwin.getSelection();
if (rng.rangeCount > 0 && window.XMLSerializer){
rng=rng.getRangeAt(0);
html=new XMLSerializer().serializeToString(rng.cloneContents());
}
}
return html;
}
Please guide me what im doing wrong??????
|
|
|
|
|
does editor1.value represents a string.
use like this :
var elemValue = editor1.value.toString();
elemValue.replace(...)...
Check if this works or not.. ?
|
|
|
|
|
editor.value is a string as if i assign a static value that is editor.value = "change text" It works
|
|
|
|
|
hai experts..
i have a regular expression validator which allows decimals with precesion 2 like 100.20
now when the user enters 100 and press tab it shuld automatically convert 100.00 it shuld not show error message .. plz guide regarding this issue
|
|
|
|
|
This sounds like basic string mashing to me. What have you got so far ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi christian.
actually i used regualr expression for decimals like it will take it as only 100.20 but when the user enters 100 it shuld be conevrt as 100.00
or 200 it shuld convert as 200.00
etc
|
|
|
|
|
Right - so it has nothing to do with the validator at all. You just want to append one or two zeros and possibly a dot, based on what the user entered.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
venu656 wrote: when the user enters 100 and press tab it shuld automatically convert 100.00 it shuld not show error message
I think you need to round your number to 2 digits while user press tab.right?
Then just call a javascript method on focus out of textbox and do your rounding there.
|
|
|
|
|
Hi there,
I want to zoom a picture on a page on mouseover. The page contains number of pictures in small size due to lack of space.
Please help me!!!!
Thanx...
|
|
|
|
|
ASP.NET can't do anything here. You may need some javascript libraries like JQuery[^].
|
|
|
|
|
Sir,
Is it possible by using ASP.NET AJAX ? . I m using it.
Thanx...
|
|
|
|
|
Hi ,
If You know so please give answer and rectify other dont make only comment.
Regards,
Amit Patel
|
|
|
|
|
ASP.NET AJAX controls are also using JS internally. I am not sure about the existence of any ASP.NET AJAX control that can do zooming.
|
|
|
|
|
hi,
Cant We Use any popup extenders for displaying images
|
|
|
|
|
If you like, sure.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
is there anyway to delete a specific column from a record like
in a table Employee
Employee_ID, Employee_Name, Employee_Image, Description
Is there any way to delete Employee_Image from one row
if yes then how??
i m using C#.net with access database
thnx
|
|
|
|
|
Hi,
if you delete a column, the column will be deleted for all rows within the table. Set the value of the column for the specific row to NULL, if you want the value to be empty.
Regards
Sebastian
|
|
|
|
|
Well, how do you think you'd work out which column to delete ? The answer is, the ID exists to identify a record. So, write SQL to remove that row, based on the ID.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
string s = "insert into appointment values('"+TextBox1.Text+ "','" + TextBox2.Text + "' , '" + DropDownList2.SelectedItem.ToString() + "','" + DropDownList1.SelectedItem.ToString() + "',#"+Calendar1.SelectedDate.ToShortDateString()+ "#,#"+time.ToShortTimeString()+"#)";
am using this query to insert values.the prob is dat the date is being stored in mm/dd/yyyy format.but i want it in dd/mm/yyyy format.can anyone help me.am using microsoft access.
|
|
|
|
|
If you wrote this code for me, I'd fire you. It's unreadable, it shows an absence of any sort of thought or design, and anyone who wants to, can attack the database and erase it.
If you wrote proper database code, the dates would be stored as dates, not in any special format. Start by reading on SQL injection attacks. Then read up on how to write proper n-tiered applications. Finally, read up on database formats and data types. If you're writing code for work, I would suggest you're a good year away from being able to write anything that anyone with any sense would remotely consider paying for. If you're teaching yourself, then you are way out of your depth, take several huge steps back and learn a step at a time, instead of learning how to do everything wrong at once.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
can u give one example on that.
|
|
|
|
|
ankitjain1110 wrote: can u give one example on that.
You voted him 1 and still expecting help?
BTW, what examples are you interested in?
|
|
|
|
|
hey i found them.and i didnt vote him 1.may be that was an mistake.wat he said is true.i do believe the same.am very new in this field.but am trying hard.i wd always be happy to get advices from ma seniors.
|
|
|
|
|
OK.
1 - your variables should have meaningful names, not textbox1, etc
2 - your SQL should exist in a seperate dll, you should NEVER have SQL in the presentation layer
3 - because you pull your text directly from a textbox, a user can type valid SQL into that textbox, and thus create SQL that runs doing things you don't want. There are articles on SQL injection here on this site
4 - if you use a date/time datatype instead of a string, then the date will show in what ever format you ask for, because it's stored as a date, and not as a specific format.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|