my head is very very full after yesterday and the day before yesterday 'playing' with __doPostBack Javascript..o no..full of code at my head now
well using that in plan to do some processing from the ClientSide script to ServerSide script
so ex: i want to validate the Date that user entered before it saved to database..
sso the scenario is something like this:
i have three HTML textbox (say DayText, MonthText, YearText) to input DateOfBirth
so my planned were used ValidateDate Javascript function to assign the three value to HTML input hidden then call ValidateDate Server side function(or code behind) and use those three HTML input hidden
and validate to see if current DayOfBirth is valid or not..(guess what happened if naughty user entered 30 - Feb - 1980)
but i make it a hard way and it ended up nothing..
just use
or if u want to clear text at WebServer textBox when got focus then simply add
asp:textbox id="DayText" MaxLength="2" Width="30px" Runat="server" CssClass="Textbox">dd
/asp:textbox
and the .net framework render the WebServer control to HTML Textbox when i view the source when the page is viewed to
input name="DayText" type="text" value="dd" maxlength="2" id="DayText" class="Textbox" OnFocus="JavaScript:if(this.value=='dd') this.value='';" style="width:30px;"
great hah?? well it JUST tooks me two days to understand it and it take a full headache also with a BIG help from a forum
bye for now
Comments