Jump to content

Cas

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Cas's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. function onul() { if (times == 0) {   var leave = confirm(your_message);   if (!leave) {     location = self.location;     times++;   }   else location = url('afile.php?refer=filename.html'); } } in afile.php do your database stuff then redirect to $_REQUEST['refer'], ie <?php header('Location:'.$_REQUEST['refer']);?> Something like that, not sure if my code is exact but play around with it. Not sure how to cancel the onunload event, its possible that if the function just returns false this might do it, but not sure, you'll have to try it...
  2. haven't tried this but give it a go. Have the textboxes disabled, ie <input type="text" disabled="1" name="textbox1"/> this will mean no user input, but you should still be able to set the value in the script
  3. Something like this? [code]<script language="javascript"> function doStuff() { var radioLength = document.f1.r1.length; var bSet = false;         for(var i = 0; i < radioLength; i++) { if(document.f1.r1[i].checked) { bSet=true; break; } }       if (!bSet)           alert("You need to vote");       else           document.f1.submit; } </script> <form name="f1"> <input type="radio" id="r1" name="r1" value="1">1</input> <input type="radio" id="r1"  name="r1" value="2">2</input> <input type="radio" id="r1"  name="r1" value="3">3</input> <input type="button" onclick="doStuff()" value="vote now"/> </form>[/code] OR [code]<script language="javascript"> function doStuff2() { document.f2.b1.removeAttribute("disabled");         document.f2.b1.setAttribute("enabled","1");       } </script> <form name="f2"> <input type="radio" id="r1" name="r1" value="1" onclick="doStuff2()">1</input> <input type="radio" id="r1"  name="r1" value="2" onclick="doStuff2()">2</input> <input type="radio" id="r1"  name="r1" value="3" onclick="doStuff2()">3</input> <input type="submit" name="b1" disabled="1" value="vote now"/> </form>[/code]
×
×
  • 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.