Showing posts with label clicks. Show all posts
Showing posts with label clicks. Show all posts

Saturday, March 31, 2012

Text Box

I have a asp.net textbox on my page with a default value in it. I would like
the box to be cleared when some one clicks on the box.
How do I go about doing this?you need to add some client-side javascript like this:

onfocus=" if ( this.value == 'some default' ) this.value=''; " onblur="
if ( this.value == '' ) this.value = 'some default' ; "

Lou Civitella wrote:

Quote:

Originally Posted by

I have a asp.net textbox on my page with a default value in it. I would like
the box to be cleared when some one clicks on the box.
How do I go about doing this?

text box cursor position on entry

Hi I want the cursor to align left when someone clicks in textbox.

textbox has maxlength of 7 when user clicks in text box

the cursor is at position 2 so they cant enter all 7 digits of number

without clicking home and reentering number.

It sounds to me like the textbox has some default text in it already. Otherwise, it would be at the left when they click in. Post your code so we can take a look.
As, suggested please check the Text property. By default when you click inside the TextBox is should align to the left at position "0".

add this in page_load...

sub page_load(byval sender as object, byval e as system.eventargs) handles page.load

txt1.text=""

end sub

cheers

moredotnet


thanks for the replies, I have put txtbox.text="" in page load will see what happens.

please use me.load instead of page.load

cheers

moredotnet


How I CAn Change the Cursor Color or Size InHTML TextBox

Thanks


Hi,

call a java script function onfocus, then set the value of text box to null and then call focus function on that control.

hope this would solve your problem


Unfortunately this not solve my problrm

When textbox.value=null ;

the textbox value be "null"


I wanna to write a dataSet as XML File

I use dataset.WriteXML("Filename"); Method

But if ther are an empty cell it will not Writen

Pls. Help Me;


Hi ,

I couldn't get you complete requirement. Can you try like this.

First check whether your data set contain rows are not . If it contains then write to xml file using

ds.WriteXML("filename.xml")

Saturday, March 24, 2012

Text prefilled but cleared as soon as somebody enters it.

I want to have a box filled in with text that when the person clicks in to
it for the first time it will clear. I'd also like to have it ( like to
google search box ) so that it's greyed text when they first see it but as
soon as they go in to it it's normal text.
I assume that what I need to do is check for when the object get's focus and
change it there and put the object in an Ajax Update Panel so it happens
automatically.
Is this correct?
TIA - Jeff.not sure what the update panel is for. this is pretty simple javascript. if
you are using ajax, then look at the watermark control in the optional
control toolkit.
-- bruce (sqlwork.com)
"Mufasa" wrote:

> I want to have a box filled in with text that when the person clicks in to
> it for the first time it will clear. I'd also like to have it ( like to
> google search box ) so that it's greyed text when they first see it but as
> soon as they go in to it it's normal text.
> I assume that what I need to do is check for when the object get's focus a
nd
> change it there and put the object in an Ajax Update Panel so it happens
> automatically.
> Is this correct?
> TIA - Jeff.
>
>

Text prefilled but cleared as soon as somebody enters it.

I want to have a box filled in with text that when the person clicks in to
it for the first time it will clear. I'd also like to have it ( like to
google search box ) so that it's greyed text when they first see it but as
soon as they go in to it it's normal text.

I assume that what I need to do is check for when the object get's focus and
change it there and put the object in an Ajax Update Panel so it happens
automatically.

Is this correct?

TIA - Jeff.not sure what the update panel is for. this is pretty simple javascript. if
you are using ajax, then look at the watermark control in the optional
control toolkit.

-- bruce (sqlwork.com)

"Mufasa" wrote:

Quote:

Originally Posted by

I want to have a box filled in with text that when the person clicks in to
it for the first time it will clear. I'd also like to have it ( like to
google search box ) so that it's greyed text when they first see it but as
soon as they go in to it it's normal text.
>
I assume that what I need to do is check for when the object get's focus and
change it there and put the object in an Ajax Update Panel so it happens
automatically.
>
Is this correct?
>
TIA - Jeff.
>
>
>

Text Size

I found an issue while working on my asp.net pages in VB. When you open the browser everything looks fine. If a user clicks view and text size and changes the size to larger all my pages are distorted. The text boxes are merged and you cant read them. Does anyone have a solution for this?How are you creating your web page? The pages should look different, but shoudl still be readable. Can you send a short aspx page that demonstrates the behaviour?

Thanks,

Russell
Sounds like you are using GridLayout as you pageLayout (but I could be wrong). I would suggest putting your information (labels and textboxes) in a table. If this dosen't work let me know and I will take a closer look.

Trey
yes I am using a grid layout
I tried to see if there was a difference with a html label or a web form label but they look the same. It seems when the text size is increased by the user it drops the second word in the textbox on another line. How do you know when to use a html label or a web form label?
here a sample

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>trash</title>
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 103; LEFT: 200px; WIDTH: 128px; POSITION: absolute; TOP: 32px; HEIGHT: 30px" cellSpacing="1" cellPadding="1" width="128" border="1">
<TR>
<TD><asp:label id="Label1" runat="server" Width="95px" Height="22px">web form label</asp:label></TD>
</TR>
</TABLE>
<DIV style="DISPLAY: inline; Z-INDEX: 102; LEFT: 338px; WIDTH: 69px; POSITION: absolute; TOP: 34px; HEIGHT: 25px" ms_positioning="FlowLayout">html
label</DIV>
</form>
</body>
</HTML>
For you table width i would use percents instead of px. I feel it is the best way if you are worried about font size increases. I would also use flowlayout for what you are trying to do. here is an example:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>trash</title>
<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="50%" align="center" border="1">
<TR>
<TD>
<asp:Label id="Label1" runat="server">Label</asp:Label></TD>
<TD>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox></TD>
</TR>
</TABLE>
</form>
</body>
</HTML>

if you give me exactly what you are doing i can see if i can get it working for you.
It looks like that will do the trick thanks a lot.