|
we are not here to do your homework. pls try for it and if you face any problem tell us we will rectify your problems.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
currently i m using asp.net with c# (2.0 framework).
i have placed a .net calendar in a webform and code behind i written the following javascript coding... (in HTML page)
<script runat="server">
public void Page_Load()
{
if (!IsPostBack)
{
Calendar1.SelectedDate = DateTime.Today;
}
}
public void buttonClose_Click(object sender, EventArgs e)
{
string returnScript = "";
returnScript += "<script language=javascript>";
returnScript += "window.opener.document.all['";
returnScript += Request.QueryString["Src"];
returnScript += "'].value = '";
returnScript += Calendar1.SelectedDate.ToString("dd-MMM-yyyy");
returnScript += "';window.close();";
returnScript += "<" + "/" + "script>";
Page.RegisterStartupScript("", returnScript);
}
</script>
I call the above webform in my MASTER page by using the below function in a button click, so that when user clicks this button the calendar will popup and selected date will asign to a textbox
(eg., OnClientClick="pickDate1('txtbox1')")
<script language="javascript" type="text/javascript">
function pickDate(Src)
{
calendar_window=window.open("Calendar1.aspx?src=" + Src, "_blank","height=180, width=200, left=660, top=300,location=no, menubar=no, resizable=yes,scrollbars=no, titlebar=no, toolbar=no", true); calendar_window.focus();
}
</script>
Now here i want to fill another textbox with YEAR ALONE (say, txtbox2) when user select the date for txtbox1 (eg., if user selects the date 01-Oct-2008 for txtbox1, then the year 2008 should be placed in txtbox2).
How to achieve it. help me - KARAN
|
|
|
|
|
hi frnds can any one tell me how can i do this,
because i dont need groove , solid dashed or any other skin provided by asp your own theme and skins
thank you.
|
|
|
|
|
You can create your custome theme in your application, just Right Click on Application - > Add Asp.Net Folder - > Add Theme Folder
now you have to add just a Css and a skin file.
and then aspx page just write inside page directive StyleSheetThme="Your Theme Name"
You can check My Article[^], although the purpose of this article is different but in that application i have used Custom Theme , just dowload the applicatio and try. let me know if any issue.
cheers,
Abhijit
|
|
|
|
|
i am using js function to check gridview value existence it was working fine for single page it doesnt check the whole records it only checks those records which are on current page,
<br />
function checkval()<br />
{<br />
<br />
<br />
var txt=document.getElementById("<%= txt_category.ClientID %>").value;<br />
var theGridView = document.getElementById("<%= gv_faculty_category.ClientID %>");<br />
if(theGridView!=null && txt!="")<br />
{<br />
for ( var rowCount = 1; rowCount < theGridView.rows.length; rowCount++ )<br />
{<br />
alert(theGridView.rows.length);<br />
if ( theGridView.rows(rowCount).cells(0).children(0)!=null)<br />
<br />
{<br />
<br />
<br />
var theGridViewLable = theGridView.rows(rowCount).cells(1).children(0);<br />
if(theGridViewLable.innerHTML==txt)<br />
{<br />
document.getElementById("<%=lbl_proceed.ClientID %>").innerHTML="Category Exists";<br />
<br />
document.getElementById("<%=hf.ClientID %>").setAttribute("value","no");<br />
break;<br />
}<br />
else<br />
{<br />
document.getElementById("<%=lbl_proceed.ClientID %>").innerHTML="Proceed";<br />
document.getElementById("<%=hf.ClientID %>").setAttribute("value", "Proceed");<br />
<br />
}<br />
}<br />
}<br />
}<br />
else<br />
{ <br />
document.getElementById("<%=lbl_proceed.ClientID %>").innerHTML=""; <br />
document.getElementById("<%=hf.ClientID %>").setAttribute("value", "Proceed");<br />
} <br />
} <br />
<br />
can u plz help me
thanks in advance
learning developer
|
|
|
|
|
function popup1(id)
{
var d=id+1;
if(document.getElementById ('TextBox' + d + ').value.length == 0')
{
window.open ('Eventdetails.aspx');
}
else
{
var id1=id;
window.open ('Timeevent.aspx?id='+id1,null,'height=212px,titlebar=no,toolbar=no,width=215px,scroll=no');
return false;
}
}
can any one tell me what is the problem in the above code?
|
|
|
|
|
raghvendrapanda wrote: if(document.getElementById ('TextBox' + d + ').value.length == 0')
check this statement. it should not be like this.
cheers,
Abhijit
|
|
|
|
|
The line:
if(document.getElementById ('TextBox' + d + ').value.length == 0')
is syntactically wrong.
It should be:
if(document.getElementById ('TextBox' + d).value.length == 0)
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
How to disabled BACK & FORWARD buttons of the browsers using javascript?
|
|
|
|
|
That is an example of one of the most important don'ts of using JavaScript.
- It isn't possible using JavaScript, as well as the fact that all browsers will handle back and forward buttons/actions in different manners.
- Remember that the user always has control over what they're doing - no matter what your page is doing, browsers have been set up and created so that the user has the control over what they're doing and web pages cannot compromise this.
- (Even if possible) removing such a core feature of the web browser would simply irritate your users and make them go elsewhere.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
This is not Possible in Web Pages. But programatically you can do.
In java script:
BACK KEY:
1. check history.forward contains any data then call in history.back().
FORWARD KEY:
1. check history.back contains any data then call in history.forward().
|
|
|
|
|
Hi, I want the code for the functionality of a backspace button
plz post
|
|
|
|
|
onkeydown="HitBackSpace()"
function HitBackSpace()
{
if (event.keyCode==8)
{
alert("backspace");
}
}
cheers,
Abhijit
|
|
|
|
|
Hi Abhijit,
I am very thankful for responding however i wud like to implement the same functionality of BackSpace button to another button in C#.Net virtually. So plz help me in tht code.
|
|
|
|
|
srinivaskonijeti wrote: however i wud like to implement the same functionality of BackSpace button to another button in C#.Net virtually.
No Clear To Me !!! can you please confirm it details ?
cheers,
Abhijit
|
|
|
|
|
Can any one tell me what is the problem in the foll code. it is not workinh.
Response.Write("");
Response.Write("windows.location.href('Eventdetails.aspx?id='" + i +");
Response.Write("");
Regards'
|
|
|
|
|
use Page.ClientScript to register a javascript rather than use Response.Write
cheers,
Abhijit
|
|
|
|
|
raghvendrapanda wrote: Response.Write("");
Response.Write("windows.location.href('Eventdetails.aspx?id='" + i +");
Response.Write("");
What are you trying to do? Are you calling this function on some button click event? Then u need to wrap it in some function name.
Otherwise you just seem like redirecting to another page which can be done using Response.Redirect("EventDetails.aspx?id=" + i);
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
Hi,
I have a requirement where i need to format the phone number in 111-111-1111 format after it loses focus.
Can any one help me how to do this?
Santhapur
|
|
|
|
|
I was curious, so whipped up a test page:
<html>
<head>
<script type='text/javascript'>
function formatValue()
{
var v = document.getElementById('val').value;
var fv = document.getElementById('fval');
var re = /^(\d{3})[-]?(\d{3})[-]?(\d{4})$/
if(re.test(v) == true)
{
fv.innerHTML = RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3;
}
else
{
fv.innerHTML = "Bad!";
}
}
</script>
</head>
<body>
<input id='val' type='text' onblur='javascript:formatValue();'></input>
<div id="fval"></div>
</body>
</html>
The magic is in the regex. You can tweak it to accept other delimiters other than "-".
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
Hey Thanks Its working but.. But i need to display the formatted output again in the textbox itself. How can we do it ?
Please help me i am a begineer in the javascript programming. Or else give me a small clue i can try it out..
Santhapur
|
|
|
|
|
In my sample, replace:
fval.innerHTML = RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3;
with:
document.getElementById('val').value = RegExp.$1 + "-" + RegExp.$2 + "-" + RegExp.$3;
You can work out the best way of handling bad input however you want, maybe an alert or an error message.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
Hey,
Thanks I did it by own and anyways Thanka a lot for your help
Santhapur
|
|
|
|
|
Glad to help, and I learned something new today.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
There are several good articles on this site in regards to regular expressions and the Expresso tool for building regular expressions. I suggest you check them out during your free time
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|