Link to home
Start Free TrialLog in
Avatar of areyouready344
areyouready344Flag for United States of America

asked on

how to create a html back button?

To create a html back button, do I need javascript and can I create a html back button without using javascript, if so, how can i accomplish this?

My html code don't use javascript...
Avatar of zwei
zwei
Flag of Sweden image


<FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"> </FORM> 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of GwynforWeb
GwynforWeb
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
....lol posts at same time, "return true" is JS
history.go is JS too.
Using javascript:
<a href = "javascript:history.back()">Back</a>
"Can I create a html back button?"

No.
Avatar of Michel Plungjan
or combining all our suggestions - the canonical


<a href="#" onClick="history.back(); return false">Back</a>

Zwei: No need for form tags and no need for return true


Avatar of areyouready344

ASKER

The command INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);;"> is not working for me. I don't have javascript in the html code...
you don't need javascript in the code to make it work, sure you have the < at the start of the statement?

   
  <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);;">


 
And history.go IS javascript
GwynforWeb, code below shows what I'm doing. As you can see, I'm loading the html code within a bash shell script. Anything you can see I'm doing wrong here?
#!/bin/bash
 
echo Step 1 
source "$start.sh" 
cat << BROWSER
@{{
<request>
<name> Test 1 </name>
<html remote="$host">
<head>
</script>
</head>
<body >
<form enctype='multipart/form-data' action='gostart' method='get' >
<p> <font size='3'> Begin 1:</font></p>
<input type='text' id='command' name='command' value='test.sh' />
<input type='submit' name='action' value='Continue' />
<input type='submit' name='action' value='Cancel' />
<input type='button' onClick='history.go(-1);;' value='Back' />
</form>
</body>
</html>
</request>
@}}
BROWSER
# wait for the user to perform the operation we requested him 
read ln
echo "action: " $ln 
echo Test 1 Passed
 
#====================================================
 
cat << BROWSER
@{{
<request>
<name> Test 2 </name>
<html remote="$host">
<head>
</head>
<body >
<form enctype='multipart/form-data' action='vide://vct' method='get' >
<p> <font size='3'> Test 2: </font></p>
<br></br>
<p> <font size='3'> Execute the esxcfg-scsidev -c command </font></p>
<input type='text' id='command' name='command' value='test2.sh' />
<input type='submit' name='action' value='Continue' />
<input type='submit' name='action' value='Cancel' />
<input type='button' onClick='history.go(-1);;' value='Back' />
</form>
</body>
</html>
</request>
@}}
BROWSER
 
# wait for the user to perform the operation we requested him 
read ln
echo "action: " $ln 
echo Test 2 Passed

Open in new window

do i need a javascript inside this bash shell script?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Is there a chance it not working because I don't have javascript in the bash shell script?
If you show the page in a browser, the javascript will work
Problem was with this limited browser that does not support javascript.