Discussion in 'HTML Development' started by cyberdyne, Aug 24, 2005.

  1. cyberdyne Member

    Hi all,
    Is it possible to use the onLoad function, ie:
    [color=black]<body onLoad="alert('Caution!!! );">[/color] 
    As an enter / dont enter option?

    ie: Click OK and you enter the site, Click No and you're redirected?

    Thank you
  2. Jack HU Moderator

    I Beleive this is what you need.

    in the head put the following:

    <script = javascript>
    function Caution()
    in the body tag:

    <BODY onload="Caution()">
    This is only an "OK" box however, not sure about yes/no ;)

    hope this helps a bit

  3. cyberdyne Member

    Thanks Jack, thats roughly what i have now, but i need an option to enter or leave if possible.
    Thanks :)
  4. Jack HU Moderator

    I'll look into it :D
  5. cyberdyne Member

    Thanks Jack, think i have it:

    onclick="javascript:return confirm('Continue ?')"
    Testing now.

    on[color=red]load[/color]="javascript:return confirm('Continue ?')"  
    .....of course

    But cancel doesnt revert away from the page unfortunately, it still loads.

    This is the sort of thing i was hoping for, but wondered if i could get this to activate with the onload function so that its the first thig the user sees and has the choice to continue or exit:
    <form action="1.php" method="post">
    <div><input type="submit" name="accept" value="Agree - Continue" /></div>
    <form action="" name="do not accept">
    <input type=button name="do not accept" value="Disagree - Exit" onClick="javascript:window.close();">
  6. Bob I think, it hurts, I stop

    Why not just have a 'cover page'?
  7. cyberdyne Member doesnt allow it. All content is written on one page.

Share This Page