...678
-
Posts
54 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by ...678
-
-
so whats the full code then?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 -
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
-
ok thanksThere 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>
-
thanks for that that worked well just 1 thingi only need oneso how do i remove Item1 and just leave Item 0try 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>
-
thats not what i want reallyI just want it with text and not images
-
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
-
THANK YOU!THATS EXACTLY WHAT I WANTED!!!!!!!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>
-
-
okbut where do i put theI 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).
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.
-
If i have a dropdown menu. i want to be able to pick one of the options, and it links to that page.
-
ki really dont understandEither if you could give me the whole code...or i just dont bother
-
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?
-
how do i make that cookie?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 you do that?You can also check if a cookie exists or not and then display or not display the page! -
Do you know what it is???Yes. -
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
-
Thanks for thatit worksA 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>
-
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 alotWell 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>
-
Ok.Im making a website, and im using iframesbut i dont know how to make it so that if you click the link on the navigation, the iFrame changes to that pageCan anyone help?
-
ThanksIve tried iFrames but they really mucked me upit's called a textarea http://www.w3schools.com/tags/tag_textarea.asp -
Is it possible to have a text box, and have a scroll bar in it so if you put lots of text, it has a scroll bar down the side...?If so please tell me the code
-
Thanx it was![url=http://www.somewhere.com][img=http://somewhere.com/somepicture.gif][/url]
Did I win?
-
soBBCodes 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?[img][url='http://whatever.com.blabla'][/url]
-
but that doesnt have anything i needi need to know how to make a picture a link plzWell, 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.
Form Buttons?
in HTML/XHTML
Posted