Jump to content

[SOLVED] Back button erratic behaviour


stockton

Recommended Posts

In one of my programs I have a button which when clicked calls another php correctly but not in the following code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Add help parent</title>
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="Mon, 22 Jul 2000 11:12:01 GMT"
<!-- Put IE into quirks mode -->
                <title>Sharing: HelpPage</title>
                <link rel="stylesheet" type="text/css" href="CSS/Help.css" />
                <link rel="stylesheet" href="/CSS/custom-theme/jquery-ui-1.7.1.custom.css"/>
                <link rel="stylesheet" href="/CSS/SiteWide.css"/>

                <script type="text/javascript" src="/JavaScripts/DWjQuery.js"></script>
                <script type="text/javascript" src="/JavaScripts/CL/ComponentLoader.js"></script>
</head>
<center>
<h2>Help Administration</h2><br>
<form name='HelpAdd' action='HelpAdd.php' method=post enctype="multipart/form-data">
<table align="center" border="3" cellspacing="0" cellpadding="3">
<tr><td>Record Type:</td>';
<td><select name="RecordType">
<option value='0'>Parent</option>

<option value='1'>Dependant</option><br/>
<tr><td>Topic Title:</td>
<td><input type="text" name="TopicName" ID="TopicName" maxlength="25"></td></tr>
<tr><td>Parent:</td>
<td><select name="Parent">
<option value=1>FAQ</option><option value=9>AnotherTest</option></td></tr>
<tr><td>Topic Body:</td>
<td><input name="helpfile" type="file" /></td></tr>

<tr><td colspan="2" align="center">
<input type="submit" name="submit" value="Submit">

<button onClick="parent.location='help.php';">Back</button>
<!-- <button onclick="window.location.href='help.php';">Back</button> -->
</td></tr>
</table>
</form>
</center>
</body>
</html>

Clicking on the button in the above just reloads the current page. This no matter if I use  I use

<button onClick="parent.location='help.php';">Back</button> or

<button onclick="window.location.href='help.php';">Back</button>

Why? Either should call help.php

Link to comment
Share on other sites

The help.php looks like

<!-- Put IE into quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> 
<head> 
	<title>Sharing: HelpPage</title>
	<link rel="stylesheet" type="text/css" href="CSS/Help.css" />
	<link rel="stylesheet" href="/CSS/custom-theme/jquery-ui-1.7.1.custom.css"/>
	<link rel="stylesheet" href="/CSS/SiteWide.css"/>
	<link rel="stylesheet" href="/CSS/jquery.treeview.css" type="text/css" media="screen" />
	<script type="text/javascript" src="/JavaScripts/DWjQuery.js"></script>
	<script type="text/javascript" src="/JavaScripts/CL/ComponentLoader.js"></script>
                <script type="text/javascript" src="/JavaScripts/jquery.treeview.js"></script>
	<script type="text/javascript">
	$(document).ready( function()
		{
		//load the standard headers.
		$("#header").LoadComponent("/dwexec/Styles/Headers/StandardHeaderInit.php");
		$("#message-paragraph").load('/DefaultFile.html');
    			$("#browser").treeview();
			$("#browser").treeview({
				add: branches
				});
		});

	function ItemSelected(File)
		{
		$.ajax({
		  url: "HelpBody.php",
		  data: "WhichOne="+File,
		  cache: false,
		  success: function(htmldata){
		    $("#message-paragraph").html(htmldata);
		    }
	 	});
		}
	</script>

<!--		<style>
	.HelpOption{
		cursor:pointer;
	}
	</style> -->
</head>
<body bgcolor="#eeeeee">
<div id="container">

<table width=100% border=0>
<tr>
<td><div class="ui-widget-header ui-corner-top">  Help Pages</div></td>
</tr>
<tr valign="top" align="left">

<td width=15% valign=top align=left class="rightborder">
<ul id="browser" class="filetree"><li class="closed"><span class="folder">FAQ</span><ul><li><span class="file" onClick=ItemSelected("2")>Grid</span></li><li><span class="file" onClick=ItemSelected("3")>NodeListEditor</span></li></ul></li><ul id="browser" class="filetree"><li class="closed"><span class="folder">AnotherTest</span><ul></ul></li>
<button id="add" onclick="window.location.href='HelpAdd.php';">Administration</button>

</td>
<td width=85% rowspan=2 valign=top>
<p id="message-paragraph">
Welcome to the help page. Please select a topic & a subject on the left to get additional help.
</p>
</td>
</tr>
</table>
<br />

</div>

<div id="header">
	loading...
</div>

</body>
</html>

and as you can see it uses

<button id="add" onclick="window.location.href='HelpAdd.php';">Administration</button>

to call the 1st program above, the one I am having a problem with.

This one works fine.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.