HTML - Problem With "history.go(-1)" Back Button
Hi, I've got three buttons on a page and basically all I'm trying to do is put a BACK button as one of the three. But I'm having difficulties getting it to work.
Code: <form name="reservationinfo" action="reservationcollected.php" method="post"> <input type="hidden" name="reservationID" value="<? echo $reservationID; ?>"> <center> <table width="400" border="0" cellspacing="5"> <tr> <td><input type="submit" value= "Reservation Collected" class="button" name="submit"></td> <td><input type="submit" value='Cancel Reservation' onclick="reservationinfo.action='admincancelreservation.php'; return true;"></td> <td><input type="submit" value='Back' onclick="reservationinfo.action='history.go(-1)'; return true;"></td> </tr> </table> </center> </form> The solutions Ive been trying either take me to reservationcollected.php OR says history.go(-1) CANNOT BE DISPLAYED. Any ideas? Cheers Similar TutorialsHey, I'm trying to write some code for expanding and concealing text You can see this in action at youtube when you click the (more) button to expand text. Suppose I had a heading: MyHeading and a body of text: MyTextHere How do I make it so that when you click MyHeading it makes MyTextHere (initially not visible) appear, and when you click MyHeading again, it makes MyTextHere disappear? Thanks Alot. A customer gave me a Word doc that they want turned into a printer friendly web page. I understand that there are tons of ways to do this but I really want the answer to the subject. What i'm referring to is a form that someone can print from the browser and "fill in the blanks" on the page where there are "underscores". My question is how to code those underscores. I tried manipulating the <hr> tag but it's putting way too much space in between each <hr>. I've already coded a "fill in the blank" line using <u> nbsp;</u> but that looks very messy. What do you guys/gals think? http://www.colletts.co.uk/winter_dolomites.htm I have the above page that redirects users to my Winter Website - the HTML below isn't valid W3C does anyone know of a better and valid way to get this done? Cheers, Mas HTML Code: <META HTTP-EQUIV="Refresh" CONTENT="2.5;URL=http://www.colletts.co.uk/winter/winter_dolomites.html" /> I was hoping someone could clue me in as to whether or not this would be possible. I'm thinking it isn't but I need to make sure. I'd like to provide a file for people to download on my website, but when they click on the link and the download window appears I don't want them to have the option of opening it. Is it possible to only give them the option to save the file? Sounds incredibly unlikely but I gotta know. How can I restrict form submission to only the Submit button? I find the forms can be submitted also by the user pressing the "enter" or the "return" key (Users typically use IE or Firefox) By a mouseover the "Submit" button, a final check of data integrity is done as follows.... <INPUT type="submit" value="Submit Form" onmouseover="validate(personal_SS.value,personal_SS.id,personal_lastname.value,personal_lastname.id, personal_firstname.value,personal_firstname.id,personal_Birthdate.value,personal_Birthdate.id)"> <INPUT type="reset" value="Clear form"> Data is 128 bit SSL encrypted function validate(strngSS,x,strngLN,y,strngFN,z,strngBD,w) { if (strngSS== "") {alert("You didn't enter a Social Security Number."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strngSS.length < 9) || (strngSS.length > 9)) {alert("The Social Security Number is the wrong length. Just use numbers, no dashes... like 123456789 not " + strngSS); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strngSS)) {alert( "The Social Security Number contains illegal characters. Just use numbers, no dashes or # signs."); document.ReturnPatientEntry.x.focus(); return; } } } validateLN(strngLN,y) validateFN(strngFN,z) validateBD(strngBD,w) } function validateLN(strng,x) { if (strng== "") {alert("You didn't enter a Last Name."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length < 3) || (strng.length > 15)) {alert("The Last Name is the wrong length. Just use letters, no dashes... " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strng)) {alert( "The Last Name contains illegal characters. Just use letters, no dashes or spaces."); document.ReturnPatientEntry.x.focus(); return; } } } } function validateFN(strng,x) { if (strng== "") {alert("You didn't enter a First Name."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length < 2) || (strng.length > 12)) {alert("The First Name is the wrong length. Just use letters, no dashes... " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strng)) {alert( "The First Name contains illegal characters. Just use letters, no dashes or spaces."); document.ReturnPatientEntry.x.focus(); return; } } } } function validateBD(strng,x) { if (strng=="") {alert("Please enter a valid Birthdate"); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length<8) || (strng.length>8)) {alert("Please enter your Birthdate in the form mm/dd/yy, not " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars=/[\-\.\m\,\ ]/; if (illegalChars.test(strng)) {alert("The Birtdate contains illegal characters, use the format mm/dd/yy, not " + strng); document.ReturnPatientEntry.x.focus(); return; } } } } I know the coding is primitive, but it works. If the "Clear form" button is pressed, multiple consecutive error messages are tripped as the form is cleared. Can I suppress this as well? Thanks, Douglas McKibbin augustasurgery.org hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. Code: <html> <head> <script type="text/javascript"> function callme(){ document.getElementById("hid").style.visibility="visible"; } function hideme(){ document.getElementById("hid").style.visibility="hidden"; } </script> </head> <body> <form name="myform"> <table width="100%" border="4" cellpadding="2" cellspacing="2"> <tr> <td class="tableheader" colspan="9">TS </td> </tr> <div style="visibility:hidden" id="hid"> <tr> <td width="17%" class="labeltext">Tran Code</td> <td width="1%" class="blanktext">:</td> <td colspan="4" class="blanktext">Name</td> </tr> <tr> <td width="17%" class="labeltext">Product Type</td> <td width="1%" class="blanktext">:</td> <td colspan="4" class="blanktext"> </td> </tr> </div> <tr> <td> </td> </tr> </table> <input type="button" onclick="callme()" value="show"> <input type="button" onclick="hideme()" value="hide"> </form> </body> </html> thx in Adv, Hanm. Hello, I want to load a page in a iframe, and when i do this, i want that page to be displayed not at the begining of that page, i want that page to be displayed at a "x" and "y" position specificated by me. How can i do that? Thank you. i have seen alot of place on web that sometimes programmers are using :- <input type="button" / > and sometimes <input type="button" > Is there any difference between the two? What is correct way of using <input> tag, is it with end slash '/' or not ? Hello, New to the forum. I was wondering how I could make a "vote" type feature on my site... for example: Which do you prefer: Apples or Bananas? (radio button) Apples (radio button) Bananas submit vote Thank you Hello, i achieved to make a neat form and all seemed to be working well. Well.. untill I tested with IE. It seems that on page 3. (The page with the 12 audio clips) When the user clicks to Submit the answers. IE fails to cooperate and proceed to the next page. Whereas Chrome and FF follow like normal.. IE does not. Is it something ive missed? Ive tested this in all IE versions 6 7 8 and 9. All fail at the same button. The form and source code can be seen here Thanks for reading. This is the first time I've ever tried this so please bear with me. I created this with some html code: http://i.imgur.com/twTo2.png What I need this to do is when the person hits submit, it sends the text in each field to a file located on the web host. I need it to look something like this: http://i.imgur.com/WFYxa.png Here's the code I have (not sure if it will help): Code: <div id="welcom_pan"> <h2><span>submit your</span>VIDEO</h2><br> <p><form> YouTube Link to Video <br><input type="text" name="youtubelink" size ="50"/><br /><br /> Do you accept the rules (below)? <br><input type="radio" name="yes" value="yes" /> Yes <input type="radio" name="no" value="no" /> No<br /><br /> What's happening in the video? </form> <form method="post"> <textarea name="comments" cols="40" rows="5"></textarea><br> </form><br> <input type="submit" value="Submit" /> </p> </div> This is the first website I've built and I've learned a ton using Dreamweaver. I'm having trouble with the "Start Now" button (left bar) at the home page for http://www.physicianlending.com. Not sure what I'm doing wrong. I thought I might need javascript, but that doesn't seem to work either. <td width="210" class="sidebarText" id="padding" align="center"> <a href="ContactMeForm.html" class="button"> <input type='image' src='startnow.gif' alt='startnow' /> <script type="text/javascript" src="ContactMeForm.html"></script> </a></td> The button appears to work fine with Firefox (mac) and Safari (mac), but on IE it's showing there's a syntax error. I'd be very grateful and much obliged for any assistance. Thanks! Hi, I have a problem with validating Strict XHTML 1.0 ... The tag: "option" doesn't have an attribute: "onchange" in currently active versions.[XHTML 1.0 Strict]... Is there a way around this? Here's the code:. <select name="birth_month" onchange="form_d('yes');" size="1" style="width:8em"> <option<?php echo empty($a_birth_month)?' selected="selected"':''?> value="" onchange="form_d('yes');" >Month</option> Thanks Only another million pages to go. Hi all, I am currently working on a website using Dreamweaver CS3. Whenever I view the (currently very basic) site in Firefox I get the line of code I entered as the title of this thread at the top of the page (directly above the banner) as if I had just typed it into the canvas area (correct term?). Whenever I view it in IE it appears just fine, not sure about other browsers though. I began by creating a template and adding it to the page you see he HTML Code: http://www.geocities.com/makotronic/indexx.htm Here is the code for the template: Code: <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- TemplateBeginEditable name="doctitle" --> <title>Template for Parish Website</title> <!-- TemplateEndEditable --> <!-- TemplateBeginEditable name="head" --> <!-- TemplateEndEditable --> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } body,td,th { font-family: Arial Narrow, Verdana, Arial, sans-serif; } .style5 {font-size: 14px} --> </style></head> <body> <table width="750" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><img src="../Images/welcomebanner.gif" width="750" height="125" /></td> </tr> <tr> <td width="160"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table></td> <td width="590" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td valign="top"><!-- TemplateBeginEditable name="Main Body" -->Main Body<!-- TemplateEndEditable --></td> </tr> </table></td> </tr> </table> </body> </html> And for indexx.htm (I added a second 'x' because I already had a 'index.htm' file in GeoCities): Code: <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/template.dwt.asp" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Welcome to the Greencastle Parish Website</title> <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="head" --> <style type="text/css"> <!-- .style8 { font-size: 36px; font-weight: bold; } --> </style> <!-- InstanceEndEditable --> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } body,td,th { font-family: Arial Narrow, Verdana, Arial, sans-serif; } .style5 {font-size: 14px} --> </style></head> <body> <table width="750" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><img src="Images/welcomebanner.gif" width="750" height="125" /></td> </tr> <tr> <td width="160"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table></td> <td width="590" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td><!-- InstanceBeginEditable name="Main Body" --> <span class="style8">Header</span> <p class="style3">Main Body</p> <!-- InstanceEndEditable --></td> </tr> </table></td> </tr> </table> </body> <!-- InstanceEnd --></html> Cheers for any help! Niall Rather than write them out i took a screenshot. So how do i get past those? So, i need to tell the browser to highlight the corresponding button after ive pressed it, when im on that page. I need it to turn black, and stay that way. Until I move away from that page. Im working with sprites, they move to the right on the hover command. This is the navigation CSS: HTML Code: /* KNOPPEN NON-FLASH */ #menu { position:relative; top:24px; left:20px; margin:0 auto 0 0; z-index:3; } #een { position:absolute; width:128px; height:125px; left:648px; top:144px; background-image:url(img/nav/1_svib.png); background-repeat:no-repeat; z-index:1; } #een:hover { background-position:-128px; z-index:1; } #twee { position:absolute; width:128px; height:125px; left:648px; top:269px; background-image:url(img/nav/2_svib.png); background-repeat:no-repeat; z-index:1; } #twee:hover { background-position:-128px; z-index:1; } #inloggen { position:absolute; width:128px; height:125px; left:648px; top:394px; background-image:url(img/nav/inloggen.png); background-repeat:no-repeat; z-index:1; } #inloggen:hover { background-position:-128px; z-index:1; } #drie { position:absolute; width:128px; height:125px; left:648px; top:519px; background-image:url(img/nav/3_svib.png); background-repeat:no-repeat; z-index:1; } #drie:hover { background-position:-127px; z-index:1;} #vier { position:absolute; width:80px; height:80px; left:660px; top:643px; background-image:url(img/nav/4back.png); background-repeat:no-repeat; z-index:1; } #vier:hover { background-position:-81px; z-index:1; } And this is the navigation HTML: HTML Code: <div id="menu"> <a id="een" href="werkwijze_svib.html"></a> <a id="twee" href="referenties_svib.html"></a> <a id="drie" href="contact.html"title=""></a> <a id="inloggen" href="inloggen.php"title=""></a> <a id="vier" href="index.html" title=""></a> </div> Please have a look on this page for the working example and see the sprite navigation. So when one of the navigation buttons is pressed, and the user is forwarded to that specific page.. The navigation on the right stays the same, I NEED THE CLICKED BUTTON TO CHANGE TO BLACK. Just like when being hovered over it! You know what I mean, right? My English sucks @ 4 am haha. Thank you for reading. Hello folks, I have written some html, xhtml possibly, which has an href to another page, the second page being in frames and in a new window. It worked fine on an Me but now in XP it won't open the 2nd window (from the link in the first) saying it can't locate file bla bla bla, check the address.... The odd thing is where there were gaps in the address which I blocked in with a " %20 " for the browser to recognise, its saying its looking for the right address but with a 25 where all the %20's are, as well as the twenties themselves, so they now appear as "html%2520code" for example. When I open the file that is the target of the link I get the typical white file not found page, but it is dividing the screen as the frames of that file tell it to do. I would appreciate somebody telling me what the error could possibly be hello, can you please give me a sample code showing the difference between ismap and usemap. I need to give a seminar on it !!!!! hello, please help me! I created my wesbite using Dreamweaver 8, and i am having problem with a "form/submit" option. I've created a form inside a "DIV layer"(inorder to be able to move around). I want the form to be able to ALERT the customer that he/she is missing a "required" field, when they hits SUBMIT BUTTON and be able to go back and "enter it" and then when they hit the SUBMIT BUTTON and all the required field are listed then it will SUBMIT the form and OPEN the POP UP WINDOW. NOW here is the problem both scrips are working but they are conflicting each other, When I go to my site and HIT the SUBMIT BUTTON without entering any fields A POP UP WINDOWS comes up and tells me i am missing the field "WHICH is what i want" but then instead of letting me go back and enter the field, it automaticly submits the form and a NEW WINDOWS comes up with the "forms submission result" and I then recived an email.. Now what can I do to correct this? How can i make it work properly? is there another simple script? i thought maybe the problem is on the ONSUBMIT action? If i have to re-write everything again i am willing to do so! I just don't understand, why does it submit the form if there are "required" fields missing? why doesn't it let me go back and type in the field and then do the rest? Please HELP here is the page where my form is located at : http://www.towone.com/formstest56.html and here is the script: </style> </head> < form action ="http://towone.com/cgi-sys/FormMail.cgi" method="POST" onsubmit="return (checkrequired(this)|createTarget(this.target));" target="formtarget"> <input type="hidden" name="recipient" value="danay@towone.com" /> <input type="hidden" name="subject" value="FORM REQUEST" /> <script> function checkrequired(which){ var pass=true if (document.images){ for (i=0;i<which.length;i++){ var tempobj=which.elements[i] if (tempobj.name.substring(0,8)=="required"){ if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().cha rAt(0)=="s"&&tempobj.selectedIndex==-1)){ pass=false break } } } } if (!pass){ alert("One or more of the required elements are not completed. Please complete them, then submit again!") return false } else return true } </script> <script type="text/javascript"> function createTarget(t){ window.open("", t, "width=600,height=550"); return true; } </script> <body> -------------AND THEN FOR THE FORM IN WHICH IS INSIDE A DIV LAYER------ ------------------------THIS IS THE SCRIPT:------------------------------- <div id="Layer8"> <form action="" method="post" name="form1" class="style3" id="form1"> <strong>Request form to be sent to you via?</strong> </p> </strong> <label>NAME: <input type="text" name ="requiredNAME" /> </label> <p> <label>EMAIL: <input type="text" name ="requiredEMAIL" id="email_add"/> </label> </p> <p> <label>FORM: <select name="Form"> <option selected="selected">Select FORM</option> <option>Pickup Order Form</option> <option>Credit Card Form</option> <option>Quote Request</option> <option>IRS W-9</option> <option>Company Package</option> <option>Truck Insurance</option> </select> </label> </p> <p> <label>SEND VIA: <select name="Recieve_Via"> <option>Email</option> <option>Fax</option> </select> </label> </p> <p> <label>FAX: <input type="text" size="3" maxlength="3" name="area" /> - <input type="text" size="3" maxlength="3" name="prefix" /> - <input type="text" size="4" maxlength="4" name="extension" /> </label> </p> <p align="center"> <input type="submit" name="Submit" onSubmit="return checkrequired (this)" "value="Submit" /> <input type="reset" name="Reset" value="Reset" /> </p> </form> </div> |