Jump to content

...678

Members
  • Posts

    54
  • Joined

  • Last visited

Posts posted by ...678

  1. don't you mean <input type="submit"value="submit" /> ?And you didn't set the method of the form <form action=""method="get" />U can also use post
    so whats the full code then?
  2. Oki want it to redirect when you click itit wont do iti thought the code was either

    <form action="submitted.html"><input type="button" value="Submit"</form>

    or

    <input type="button" value="Submit" action="submitted.html"></form>

    Please help

  3. There is a small change in the Javascript part and commented the <div> in HTML.....
    <html><head>	<title></title>	<script>			//clickable item ids		var items = ["item0"];		// EDIT: Modify this to add/remove menu		//function to open and close items		function toggle()		{			//get item			var item = this.parentNode;	//note: this = anchor from attachEvents			//get subitem			var subitem = document.getElementById(item.id + "sub");			//toggle subitem			if(subitem.style.display == "none") //closed				//open it				subitem.style.display = "block";			else //open				//close it				subitem.style.display = "none";						//prevent anchor from following href			return false;		}		//function to attach events		function attachEvents()		{			for(i=0;i<items.length;i++)			{				//get next item				var item = document.getElementById(items[i]);				//get item anchor				var anchor = item.childNodes[0];				//attach onclick event				anchor.onclick = toggle;			}		}				//initial setup		function init()		{			//hide all sub items			for(i=0;i<items.length;i++)			{				//get next item				var item = document.getElementById(items[i]);				//get subitem				var subitem = document.getElementById(item.id + "sub");				//hide subitem				subitem.style.display = "none";				//indent subitem				subitem.style.paddingLeft = "10px"; 			}		}		</script></head><body>	<div id="menu">	   <div id="item0"><a href="#">Item 0</a></div>		<div id="item0sub">			<div id="item00"><a href="#">Item 0.0</a></div>			<div id="item01"><a href="#">Item 0.1</a></div>			<div id="item02"><a href="#">Item 0.2</a></div>		</div>		<!-- <div id="item1"><a href="#">Item 1</a></div>		<div id="item1sub">			<div id="item10"><a href="#">Item 1.0</a></div>			<div id="item11"><a href="#">Item 1.1</a></div>			<div id="item12"><a href="#">Item 1.2</a></div>		</div>-->	</div>		<script>		init();		attachEvents();	</script></body></html>

    ok thanks
  4. try this
    <html><head>	<title></title>	<script>			//clickable item ids		var items = ["item0","item1"];				//function to open and close items		function toggle()		{			//get item			var item = this.parentNode;	//note: this = anchor from attachEvents			//get subitem			var subitem = document.getElementById(item.id + "sub");			//toggle subitem			if(subitem.style.display == "none") //closed				//open it				subitem.style.display = "block";			else //open				//close it				subitem.style.display = "none";						//prevent anchor from following href			return false;		}				//function to attach events		function attachEvents()		{			for(i=0;i<items.length;i++)			{				//get next item				var item = document.getElementById(items[i]);				//get item anchor				var anchor = item.childNodes[0];				//attach onclick event				anchor.onclick = toggle;			}		}				//initial setup		function init()		{			//hide all sub items			for(i=0;i<items.length;i++)			{				//get next item				var item = document.getElementById(items[i]);				//get subitem				var subitem = document.getElementById(item.id + "sub");				//hide subitem				subitem.style.display = "none";				//indent subitem				subitem.style.paddingLeft = "10px"; 			}		}		</script></head><body>	<div id="menu">		<div id="item0"><a href="#">Item 0</a></div>		<div id="item0sub">			<div id="item00"><a href="#">Item 0.0</a></div>			<div id="item01"><a href="#">Item 0.1</a></div>			<div id="item02"><a href="#">Item 0.2</a></div>		</div>		<div id="item1"><a href="#">Item 1</a></div>		<div id="item1sub">			<div id="item10"><a href="#">Item 1.0</a></div>			<div id="item11"><a href="#">Item 1.1</a></div>			<div id="item12"><a href="#">Item 1.2</a></div>		</div>	</div>		<script>		init();		attachEvents();	</script></body></html>

    thanks for that that worked well just 1 thingi only need oneso how do i remove Item1 and just leave Item 0
  5. I want an expanding menu so when you click the main link more links are under it if you know what i mean...Like thisLink--- Hidden Link--- Hidden LinkAnd the hidden links appear when you click the linkId like it to be in JavaScript if possible as i am not familiar with CSS.I have googled it but they dont seem to work

  6. If you need a prompt to come up when the page loads and ask for password and redirect....
    <html><HEAD><script language="JavaScript">var password;var pass1="cool";password=prompt('Please enter your password to view this page!',' ');if (password==pass1) {  alert('Password Correct! Click OK to enter!');  window.location.href="correctpage.htm"}else{ window.location="errorpage.htm";}</SCRIPT></HEAD>	<body>	</body></html>

    THANK YOU!THATS EXACTLY WHAT I WANTED!!!!!!!
  7. I wanted to password protect a few of my pages too, and although everyone told me it's better to do it with php, I did it with javascript. It's secure enough for me considering the info behind the password protection script isn't sensitive stuff:Here's the javascript code:
    function protect(form) { if (document.passform.password.value == "password here") {  alert("Password correct, forwarding...");  document.location.href="members.html"; } else {  alert("Password Incorrect"); }

    The document.passform.password.value would be the <input type="text"> field on the form (in this case the form is named "passform")Here's the form:

    <form name="passform"> Password: <input type="password" name="password" /> <BR> <input type="submit" value="Submit" onClick="protect(form)"></form>

    So that's it. Useful if you're not protecting any sensitive stuff (credit card details and such).

    okbut where do i put the
    function protect(form) {if (document.passform.password.value == "password here") {  alert("Password correct, forwarding...");  document.location.href="members.html";} else {  alert("Password Incorrect");}

    Im not really sure what im doing.

  8. Ok..Im not sureso..If i have a form that looks like this :

    <form name="input" action="logintest2.htm" method="get"><br>Password<input type="password" name="LastName" value="" size="20"><br><input type="submit" value="Submit">

    How do i make it so there is a set password and if they get it right they go to one pageif they get it wrong they go to another?

  9. You would have to use either a Browser Scripting language (JavaScript etc) or a Server Scripting Language (PHP,ASP(.NET),ColdFusion etc). Then check if the user has a cookie set that would allow them to view the page. If they do, show the page, and if not, don't show the page.
    how do i make that cookie?
  10. Is there a code that makes a page password protectedSo like you go on the page and it comes up with a prompt box saying enter password. Then if its right it redirects to the page selected and if its wrong it redirects to a page with Wrong PasswordIf there is please tell me

  11. A much simpler method would be to use the target attribute in your links and a name attribute in the iframe:
    <iframe name="MyFrame" src="default.asp"></iframe><ul><li><a href="http://www.w3schools.com/" target="MyFrame">W3 Schools</a></li><li><a href="http://www.google.com/" target="MyFrame">Google</a></li></ul>

    Thanks for thatit works :)
  12. Well you could use JavaScript.
    <script type="text/javascript">function changeFrame(){ document.getElementById('iframe1').src="NEW LOCATION"}</script><a href="java script:changeFrame()">The link</a><iframe src="SOME URL"id="iframe1"></iframe>

    With that code, where do i put the link that it changes to?AlsoIll try and explain better.On the site there is the navigation, and the content shows in an iFrame in a different section. So I want to be able to click the link on the navigation and the iFrame changes to the content that that link would showWhat are table designs?If you could post a link that would help alot
  13. BBCodes are very simmilar to HTML elements. If you learn the one, you should be OK with the other one. Don't you know HTML or at least enough to know how to make a picture a link? No? Well, here's the simple logic:<a href="link"><img src="image.jpg" /></a>Knowing that with BBCode, links are specified like and images are specified by , what do you think the code for an image inside a link will be?

    so
     [img][url='http://whatever.com.blabla'][/url]

  14. Well, that can very easily be done as a topic by one of us mods, but I don't feel it's necessary. When posting, on the left side of the textbox there is a menu with smileys, and underneath a link called BB Code Help.

    but that doesnt have anything i needi need to know how to make a picture a link plz
×
×
  • Create New...