Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript Issue?

Status
Not open for further replies.

Happy100

Technical User
Jun 25, 2004
102
GB
Hi

I was kindly gaven this code to use on my pages

<SCRIPT language=JavaScript type=text/JavaScript>
function
s(){location="demo.html?"+(document.referrer?document.referrer:"none")}
</SCRIPT>

<A onclick="s();return false"
href=" </A>

and

<script type="text/JavaScript">
onload=function(){
with(document.forms[0]){
jsenabled.value="Yes";
loc.value=String(location.search).substring(1);
ref.value = document.referrer?document.referrer:"No document referrer";
}
}
</script>

<form>
<p><input name="jsenabled" type="text" value="No" size="6">JSenabled?</p>
<p><input name="loc" type="text" value="" size="80">Referrer referrer</p>
<p><input name="ref" type="text" value="jsOff" size="80">Referrer</p>
</form>

I have added the code into these pages, -
(my web form)
but I need the onclick bit to work from a submit form button, which is
sending
the form data through a perl script in my cgi-bin.
I added the onclick="s();return false" to this button, but it stops the form
data
being sent by email?

This is what I have so far -

I'm very much a novice when it comes to JavaScript!

Anyone have any ideas what I need to add to the submit button
to make the whole thing come together?

Many thanks

Happy.
 
If you want the form to be submitted, get rid of the return false. If you want to relocate to a new page, leave it in. You can't do both in the same window.

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top