|
how do i set a button as default in a webform. when my users press enter i want my submit button to happen right now my reset buttons happens
thanks
chad
|
|
|
|
|
// C#
private void SetDefault(Button myDefaultBtn)
{
this.AcceptButton = myDefaultBtn;
}
The Devil Lives in all of us, It's up to you to let HIM/HER out!!!!!
|
|
|
|
|
May i know who have solution for my current problem when using Microsoft Multimedia Control 6.0 activeX control in VBSCRIPTS in HTML Page.
Problem :
I make a simple html page which having Multimedia Control.
The formated harddisk installed with WINXP without Visual Studio installed,
successful download the [Microsoft Multimedia Control, version 6.0] into
c:\Windows\Downloaded Program Files.
However, when open that HTML page with that control, it not able to load the control successful.
The same HTML file, i already tested on other pcs without any problem.
(Note: Others pcs have Visual Studio 6.0 Pro installed)
Wish anyone who know the way to solved my problem.
Code :
<object classid="clsid:C1A8AF25-1257-101B-8FB0-0020AF039CA3"
codebase="http://activex.microsoft.com/controls/vb6/MCI32.CAB"
height="50" width="400" id="MMControl1">
|
|
|
|
|
I want to create a javascript tha achoieves the fullowing functions
1. when page loads it shows images from random locations
2. Whenever the user click the mouse anywhere on the browser the images should be hidden
3. After some time duration diaplay the images again
here is my code
<html>
<body>
<script language="JavaScript1.2">
<!--
Cupid=new Image();
loaded =true;
Cupid.src="bat.gif"; //specify path to bat image
amount=3; //Number of cupids, minimum must be 3.
Xpos=700; //cupids x coordinates, in pixel
Ypos=200; //cupids y coordinates, in pixel
step=0.3; //Animation speed (smaller is slower)
dismissafter=15; //seconds after which Cupids should disappear, in seconds
yBase=xBase=currStep=a_count=0;
flycupid=0;
b_count=1;
c_count=2;
d_count=3;
move=1;
var ns6=document.getElementById&&!document.all
bats=new Array(3)
if (document.layers){
//alert('start in if1');
for (i=0; i < amount; i++)
{
document.write("<LAYER NAME=n"+i+" LEFT=0 TOP=-50><a href='http://www.dynamicdrive.com'><IMG SRC='"+Cupid.src+"' NAME='nsi' width=69 height=60 border=0></a></LAYER>")}
}
else if (document.all||ns6)
{
document.write('<div id="out" style="position:absolute;top ;left "><div id="in" style="position:relative">');
for (i=0; i < amount; i++)
{
if (document.all)
{
document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="msieBats" style="position:absolute;top:-50;left " border=0></a>')
//alert('start in if2');
}
else
document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="ns6Bats'+i+'" width=69 height=60 style="position:absolute;top:-50;left " border=0></a>')
}
document.write('</div></div>');
}
if (document.layers||ns6)
{
//alert('start in if3');
yBase=window.innerHeight/3;
xBase=window.innerWidth/6;
if (document.layers)
window.captureEvents(Event.MOUSEMOVE);
}
if (document.all)
{
yBase = window.document.body.offsetHeight/3;
xBase = window.document.body.offsetWidth/6;
}
if (document.layers)
{
for (i=0; i < amount; i++)
document.layers['n'+i].document.images['nsi'].src=Cupid.src
}
else if (document.all)
{
for (i=0; i < amount; i++)
{
document.all.msieBats[i].src=Cupid.src
//alert('start in if6');
}
}
else if (ns6)
{
for (i=0; i < amount; i++)
document.getElementById("ns6Bats"+i).src=Cupid.src
}
function dismisscupid()
{
clearInterval(flycupid)
if (document.layers)
{
for (i2=0; i2 < amount; i2++)
{
document.layers['n'+i2].visibility="hide"
}
}
else if (document.all)
document.all.out.style.visibility="hidden"
else if (ns6)
document.getElementById("out").style.visibility="hidden"
}
function cleanUP()
{
Cupid=new Image();
Cupid.src="bat.gif"; //specify path to bat image
amount=3; //Number of cupids, minimum must be 3.
Xpos=700; //cupids x coordinates, in pixel
Ypos=200; //cupids y coordinates, in pixel
step=0.3; //Animation speed (smaller is slower)
dismissafter=15; //seconds after which Cupids should disappear, in seconds
yBase=xBase=currStep=a_count=0;
flycupid=0;
b_count=1;
c_count=2;
d_count=3;
move=1;
var ns6=document.getElementById&&!document.all
bats=new Array(3)
if (document.layers){
for (i=0; i < amount; i++)
{
document.write("<LAYER NAME=m"+i+" LEFT=0 TOP=-50><a href='http://www.dynamicdrive.com'><IMG SRC='"+Cupid.src+"' NAME='nsi' width=69 height=60 border=0></a></LAYER>")}
}
else if (document.all||ns6)
{
document.write('<div id="out" style="position:absolute;top ;left "><div id="in" style="position:relative">');
for (i=0; i < amount; i++)
{
if (document.all)
{
document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="msieBats" style="position:absolute;top:-50;left " border=0></a>')
}
else
document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="ns6Bats'+i+'" width=69 height=60 style="position:absolute;top:-50;left " border=0></a>')
}
document.write('</div></div>');
}
if (document.layers||ns6)
{
yBase=window.innerHeight/3;
xBase=window.innerWidth/6;
if (document.layers)
window.captureEvents(Event.MOUSEMOVE);
}
if (document.all)
{
yBase = window.document.body.offsetHeight/3;
xBase = window.document.body.offsetWidth/6;
}
if (document.layers)
{
for (i=0; i < amount; i++)
document.layers['m'+i].document.images['nsi'].src=Cupid.src
}
else if (document.all)
{
for (i=0; i < amount; i++)
{
document.all.msieBats[i].src=Cupid.src
//alert('start in if6');
}
}
else if (ns6)
{
for (i=0; i < amount; i++)
document.getElementById("ns6Bats"+i).src=Cupid.src
}
}
//
function Animate()
{
a_count+=move;
b_count+=move;
c_count+=move;
currStep+=step;
if (a_count >= bats.length) a_count=0;
if (b_count >= bats.length) b_count=0;
if (c_count >= bats.length) c_count=0;
if (document.layers)
{
for (i=0; i < amount; i++)
{
var NewL="n"+i
document.layers[NewL].top = Ypos+yBase*Math.sin(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/10)
document.layers[NewL].left =Xpos+xBase*Math.cos(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/62)
}
}
if (document.all){
for (i=0; i < amount; i++)
{
document.all.msieBats[i].style.pixelTop = Ypos+yBase*Math.sin(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/10)
document.all.msieBats[i].style.pixelLeft =Xpos+xBase*Math.cos(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/62)
}
}
if (ns6)
{
for (i=0; i < amount; i++)
{
document.getElementById("ns6Bats"+i).style.top = Ypos+yBase*Math.sin(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/10)
document.getElementById("ns6Bats"+i).style.left =Xpos+xBase*Math.cos(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/62)
}
}
}
function moveToClick(evt) {
loaded =false;
evt = (evt) ? evt : event;
dismisscupid();
//cleanUP();
flycupid=setInterval('Animate()',30);
}
function startup() {
flycupid=setInterval('Animate()',30);
//dismisscupid
//setTimeout("dismisscupid()",3*1000);
}
window.onload = startup;
document.onmousedown = moveToClick;
//-->
</script>
</body>
</html>
but this doesn'tachieve the 3rd funcion.Can anybody tell me wht's wrong with this script.
|
|
|
|
|
Who can help me answer this question? ;PThanks!
|
|
|
|
|
|
NO.
You can access the varibales of the other form using javascript but action will take your page to only one url.
Code below:
Here u will be redirted to test1.html
|
|
|
|
|
So, you mean each HTML page can have one or more forms, but more than one form can not be submitted at one time, right?
Thank you, man!
|
|
|
|
|
|
Hi,
i want to embed a signed windows forms control (assembly with strong name, using a .snk key pair) into a html page. Using the normal <object>-tag works fine with the unsigned control, but doesn't work with the signed one! The signed control doesn't even open! In both cases i used the same html code. Is there information missing (e.g. about the key pair)?
Thanks a lot for your help!
Fridtjof
|
|
|
|
|
Hi,
here some additional informations:
1. I used sn -k key.snk for generating the key pair.
2. Then I used an attribute in the AssembyInfo.cs file to sign the control:
[assembly: AssemblyKeyFile("key.snk")]
3. In the html page the code
<object id="A" classid="http:ALib.dll#ALib.MyACtl"
width="568" height="416">
</object>
worked fine with the unsigned control. I used exactly the same code with the encrypted control. It seems to me that Internet Explorer cannot find the class "ALib.MyACtl" any more. Maybe since it is encrypted now???
Thanks for any advice,
Fridtjof
|
|
|
|
|
hai,
I'm new to asp...and i'm using javascript.I am developing a webpage where it has some list boxes..and the user has to select the values from the list boxes..when the user goes to the next page i want to set the user selection to session variables and display them...I'm getting the selections using form and Request.Form("..")..i want to know howto set these as session variables..
thanks a lot.
|
|
|
|
|
<%
Session("name") = Request.Form("name")
Session("surname")= Request.Form("surname")
%>
--junior coder--
|
|
|
|
|
I am developing a website that uses the same images on some secure and unsecure pages. I know I can't keep the secure images in the cache so I have to load them every time I link to a new secure page. I have a javascript that loads the images in the head section of the secure pages. It seems to work on Internet Explorer on Windows but other browsers/platforms are only displaying the first image. Does anyone know what might cause this problem?
Also, is anyone aware of a better way to keep secure images around(i.e. in the cache) or a way of tricking the browser into thinking that my previously cached unsecure images are actually secure, without getting the annoying popups about secure and unsecure items.
dzs
|
|
|
|
|
One thing you may want to try is using the following code in your page:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
This should trickle down to the images as well, but don't quote me on it.
|
|
|
|
|
Is there an easy way to change References? I would like to change the references to a number of DLL's when going from test to production.
|
|
|
|
|
Hey there!
I've developing an webpage wich contains an ActiveX (signed), and a javascript to go with it. How do i sign the javascript part of the page??
Thanx
|
|
|
|
|
hi guys, this is one date that i have
Thu Jan 10 00:00:00 UTC+0800 2002
can i change is to any other format eg. "dd-MM-yyyy hh:mm:ss" or something else using javascript on the client side?
any help appreciated...
thx
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
Have you tried the Date Object?
"An expert is a person who has made all the mistakes that can be made in a very narrow field." - Neils Bohr
|
|
|
|
|
no.... could u help me out here.....
how can i change my exsisting string -> Thu Jan 10 00:00:00 UTC+0800 2002
to a more normal string like "dd-MM-yyy" or something using the date object???
thx...
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
strtotime possibly, seems to work with a UTC string
"An expert is a person who has made all the mistakes that can be made in a very narrow field." - Neils Bohr
|
|
|
|
|
Sorry I think I gave you a PHP solution, I must keep off the wine!
Try this:-
<br />
<script language="JavaScript"> <br />
<br />
time = Date.parse("Mon Jan 12 10:00:00 UTC+0800 2004");<br />
newDate = new Date(time);<br />
<br />
alert(newDate.toString());<br />
<br />
</script><br />
"An expert is a person who has made all the mistakes that can be made in a very narrow field." - Neils Bohr
|
|
|
|
|
First, you need to set up functions to return the day and month names, since the JS Date object doesn't include them:
Date._dayNames = new Array(
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday");
Date._dayNamesA = new Array(
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat");
Date.prototype.getDayName = function(abbreviate)
{
if (isNaN(this))
return "";
else if (true == abbreviate)
return Date._dayNamesA[this.getDay()];
else
return Date._dayNames[this.getDay()];
}
Date._monthNames = new Array(
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");
Date._monthNamesA = new Array(
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"June",
"July",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec");
Date.prototype.getMonthName = function(abbreviate)
{
if (isNaN(this))
return "";
else if (true == abbreviate)
return Date._monthNamesA[this.getMonth()];
else
return Date._monthNames[this.getMonth()];
}
Then, you need to use a regular expression to parse the format string and substitute the real values:
Date._reFormat = /(\\{0,1})(dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|gg|g|hh|h|ss|f+|tt|t|zzz|zz|z)/gi;
Date.prototype.format = function(format)
{
if (isNaN(this)) return this.toString();
if (!format || 0 == format.length) return this.toString();
var value = this;
return format.replace(Date._reFormat, function($0, $1, $2)
{
var fmt = $2;
if (!fmt || 0 == fmt.length) return "";
var ret = "";
if ("\\" == $1)
{
ret = fmt.charAt(0);
fmt = fmt.substr(1);
if (0 == fmt.length) return ret;
}
switch(fmt.toLowerCase())
{
case "dddd":
{
ret += value.getDayName();
break;
}
case "ddd":
{
ret += value.getDayName(true);
break;
}
case "dd":
{
var d = value.getDate();
if (d < 10) ret += "0";
ret += d;
break;
}
case "d":
{
ret += value.getDate();
break;
}
case "mmmm":
{
ret += value.getMonthName();
break;
}
case "mmm":
{
ret += value.getMonthName(true);
break;
}
case "mm":
{
if ("MM" == fmt)
{
var m = value.getMonth() + 1;
if (m < 10) ret += "0";
ret += m;
}
else if ("mm" == fmt)
{
var m = value.getMinutes();
if (m < 10) ret += "0";
ret += m;
}
else
{
ret += fmt;
}
break;
}
case "m":
{
if ("M" == fmt)
{
var m = value.getMonth() + 1;
ret += m;
}
else
{
ret += value.getMinutes();
}
break;
}
case "yyyy":
{
ret += value.getFullYear();
break;
}
case "yy":
{
ret += value.getFullYear().toString().substr(2);
break;
}
case "y":
{
var y = value.getFullYear().toString().substr(2);
if ("0" == y.charAt(0)) y = y.substr(1);
ret += y;
break;
}
case "gg":
case "g":
{
var y = value.getFullYear();
if (y >= 0)
ret += "AD";
else
ret += "BC";
break;
}
case "hh":
{
if ("HH" == fmt)
{
var h = value.getHours();
if (h < 10) ret += "0";
ret += h;
}
else if ("hh" == fmt)
{
var h = value.getHours();
if (0 == h)
h = 12;
else if (h > 12)
h -= 12;
if (h < 10) ret += "0";
ret += h;
}
else
{
ret += fmt;
}
break;
}
case "h":
{
if ("H" == fmt)
{
var h = value.getHours();
if (h < 10) ret += "0";
ret += h;
}
else
{
var h = value.getHours();
if (0 == h)
h = 12;
else if (h > 12)
h -= 12;
ret += h;
}
break;
}
case "ss":
{
var s = value.getSeconds();
if (s < 10) ret += "0";
ret += s;
break;
}
case "tt":
{
var h = value.getHours();
if (12 <= h)
ret += "PM";
else
ret += "AM";
break;
}
case "t":
{
var h = value.getHours();
if (12 <= h)
ret += "P";
else
ret += "A";
break;
}
case "zzz":
{
var off = -value.getTimezoneOffset();
if (off < 0)
{
ret += "-";
off = -off;
}
else
{
ret += "+";
}
var offH = Math.round(off / 60);
off -= 60 * offH;
if (offH < 10) ret += "0";
ret += offH;
ret += ":"
if (off < 10) ret += "0";
ret += off;
break;
}
case "zz":
{
var off = -Math.round(value.getTimezoneOffset() / 60);
if (off < 0)
{
ret += "-";
off = -off;
}
else
{
ret += "+";
}
if (off < 10) ret += "0";
ret += off;
break;
}
case "z":
{
var off = -Math.round(value.getTimezoneOffset() / 60);
if (off < 0)
{
ret += "-";
off = -off;
}
else
{
ret += "+";
}
ret += off;
break;
}
default:
{
if (/^f+$/gi.test(fmt))
{
var f = value.getMilliseconds() / 1000;
var div = Math.pow(10, fmt.length);
f = Math.round(f * div);
ret += f;
}
else
{
ret += fmt;
}
}
}
return ret;
});
}
Finally, call the new format function to format your date:
var dte = new Date("Thu Jan 10 00:00:00 UTC+0800 2002");
alert(dte.format("dd-MM-yyyy hh:mm:ss"));
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello All,
I'm trying to setup some form of webproxy server. The proxy will be frontend and internet gateway for 2 seperate servers in the backend. Unfortuntely I'm a newbie when it comes to network programming in windows. Here is the logic, the proxy will be the first point for all incoming web traffic. The task is an efficient method of scaning incoming traffic on the http port(80) and ftp port(21) for a particular file format such as Word document(*.doc) or xml(*.xml) "Posted" or "Uplaoded" to the server. If any of these for file formats are detected it will be saved directly onto the proxy server, otherwise it will be redirected immediately to any of the 2 backend servers without saving it 1st onthe proxy server (if this is possible). I'll appreciate a better insight into how this might be done. Also suggestion of web links to resources for this task will be appreciated also.
Thanks
|
|
|
|
|
Hi everybody!
1. I have a pointer to IHTMLDocument, displayed in IE.
2. HTML Document contains scripts
3. How can I order execution of certain jscript functions in that document?
Thanks for you help.
|
|
|
|