try to use this method -> http://www.haneng.com/Forums_Post.asp?id=11457&p=7
To get input like you want you should use html and perl (or any other lang)
------some.html---------
....
<form method=get action='some.pl'>
<input type=text name=file value=text>
<input type=text name=file2 value=text2>
</from>
....
this makes some.html?file=text&file2=text2
-----some.pl------
....
$tempbuffer=$ENV{'QUERY_STRING'}; #reads file=test&file2=text2
....
#then you just split them up and do something
I think he meant how to do the drop down list like when you typing in the google sugest search ( http://www.google.com/webhp?complete=1&hl=en ).
I think you mean mean it this way:
Before we process input from form we should validate it by using javascript. To validate checkboxes or any other elements of the form you should put return statement in the onSubmit statement>>>
<script language=javascript>
function validate(){
var email=document.forms[0].email.value;
var comment=document.forms[0].comment.value;
if(email==""||(email.indexOf('@')==-1)||(email.indexOf('.')==-1)){
alert("E-mail field is invalid!");
document.forms[0].email.focus();
return false;
}
if(comment==""){
alert("Comment field is empty!");
document.forms[0].comment.focus();
return false;
}
return true;
}
</script>
<form name="contact_form" method="post" action="http://..." onSubmit="return validate()">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
validate() returns boolean value that tells the form to post input or not.
This was basics validation
To validate checkboxes you need to check value(checked or not)
<script language=javascript>
function validate(){
var email=document.forms[0].email;
if(email.checked!=true){
alert("Email is not checked!");
return false;
}
return true;
}
</script>
----------------------------------
PS: you can use model document.formname.objectname.checked instead of document.forms[0].email but some netscape browsers will generate error
PS: document.forms[number].email- number is a number of the form on the page (starts form 0)
Thank you for answer but i am not sure because i saw somewhere it.
you can call predefined function find like (ctrl+f) and it will return result.
then you look at the result and take it. sounds easy but how to do that. i am sure i saw that method somewhere ...
Thanks
-------------------------
Also i dont know what's it . Is it bug in IE. Sometimes(if i ususally open page it works but when i refresh it it gives me error) when set interval to 1 milisecond (setInterval("func()", 1)) browser gives me error 'getElementById is null or not an object'.
|
\/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Progress Bars</title>
<script>
var curr=0;
var curr1=1;
var max=8;
var str="";
function add(){
curr++;
str=str.concat("");
document.getElementById('pb').innerHTML="<b>"+str+"</b> "+curr;
}
var count=setInterval("add()", 3000);
function add1(){
curr1++;
document.getElementById('pb1').style.width=curr1;
}
function clearAll(){
clearInterval(count);
clearInterval(count1);
}
var count1=setInterval("add1()", 100);
setTimeout("clearAll()", 200000);
</script>
</head>
<body>
<div name=pb id=pb style="border: 1px solid blue; height: 20px" valign=center></div>
<div style="position: absolute; left: 120px; top: 90px; background-color: red; width: 1px; height: 20px" name=pb1 id=pb1></div>
</body>
</html>
very useful thing that progress bars...
Thanks again
Everyone knows yahoo mail. When you just logged on to your account you see on the page "You have 0 unread messages". I just womdered is there any way how can i find something on the page using javascript and return as variable. So what i've done is:
1. I have a frame with src="http://mail.yahoo.com"
2. every 10 seconds it refreshes iframe
Now i need to find in the content of iframe that "simple number" and display it on the title.
Example @ http://www.geocities.com/cppforlife/projects/html/yahoo.html
thanks everyone...
you mean win32 or vcl?
win32 API:
http://www.functionx.com/win32/index.htm ****
http://www.winprog.org/tutorial/ ***
or visit this page for complete list of them and others:
http://www.geocities.com/cppforlife/links.html
What was your fisrt complete project?
--------------
Just to know what people made.
Thank you Daishi
It realy good tutorial but i have another question.
Do you know some free web hosting like geocities but that supports c/c++?
Thank you again!
Can someone point me to some nice tutorial about CGI using C++!
Tahnk you.
Sorry i mistyped 'onUnload'
(working example @ http://www.geocities.com/cppforlife/projects/html/thankyou.html)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Thank You!!!</title>
<script language=javascript>
function thankYou(){
var win=window.open("panel.html", "win");
}
</script>
</head>
<body onUnload="thankYou()">
<a href="http://www.yahoo.com">Y!</a>
</body>
</html>
code above checked in IE and worked properly..
Also replace 'panel.html' with url of you thenk you page.
If you want to change size of the window and other attributes add third argument to open function like below
var win=window.open("panel.html", "win", "left=20,top=20,width=500,height=500");
Good luck.
You 're right.
I met this question on other forum like about 20 times.
Better create a separate snippet for this program!!!
Ok, i found that switchImage(place) didn't have closing bracket so that's why was error. (I think so). I didn't see slideshow images but i suppose that it will work.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>KD Builders</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="KDBuilders1.css" media="screen" />
</style>
<script language="JavaScript">
<!--
var interval = 1500;
var random_display = 0;
var imageDir = "my_images/";
var imageNum = 0;
imageArray = new Array();
imageArray[imageNum++] = new imageItem(imageDir + "01.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "02.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "03.jpg");
var totalImages = imageArray.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function randNum(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
imageNum = randNum(0, totalImages-1);
}
else {
imageNum = (imageNum+1) % totalImages;
}
var new_image = get_ImageItemLocation(imageArray[imageNum]);
return (new_image);
}
function getPrevImage() {
imageNum = (imageNum-1) % totalImages;
var new_image = get_ImageItemLocation(imageArray[imageNum]);
return (new_image);
}
function prevImage(place) {
var new_image = getPrevImage();
document[place].src = new_image;
}
function switchImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "switchImage('"+place+"')";
timerID = setTimeout(recur_call, interval);
}
// -->
</script>
</head>
<body>
<div id="container">
<div id="pageHeader"><IMG src="logo2.gif" height="80" width="250" />
</div>
<div id="button">
<ul>
<li><a href="Index.htm">Home</a></li>
<li><a href="GabionBaskets.htm">Gabion Baskets</a></li>
<li><a href="BuildingWork.htm">General Building</a></li>
<li><a href="ContactUs.htm">Contact Us</a></li>
</ul>
</div>
<DIV id=CenterBox><IMG src="image11.jpg" align=default>
<IMG src="image9.jpg" align=default>
<IMG …
Hello all!
This is very good site and i liked it. My name is dmitriy and i am russian. I am new to C++ (about 3 month ) but i like it so much.
Try create function in javascript like below:
<script language=javascript>
function thankYou(){
var win=window.open('your popup url', 'thank you', 'window_options');
}
</script>
and insert in the body tag:
<body onunload="thankYou()">
not sure. try it.
You can use Win32 API to do that.
Nice example of using API @ http://www.daniweb.com/code/showsnippet.php?codeid=173
Any more questions? ->>cppforlife@yahoo.com