rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: kaler on September 01, 2009, 03:51:38 PM

Title: java script question
Post by: kaler on September 01, 2009, 03:51:38 PM
in my last post i had a script, which deactivate your account, when you put in the rigth code.

Now i have a question:

My script is activate, when you put in the wrong code and then it abort the request
and it is activated, when the user out in the rigth code, and there is an alert : "do you want to delet your account."

But i dont know how i make two butten (ok and reset) i can only one withe he funktion yes or no. can you help me

Here the code:

Code: [Select]
<script type="text/javascript">
function validateCode(form){
if (form.code1.value != form.code2.value){
alert("%user%! The Code is wrong. Please try again.");
return false;
  }
if (form.code1.value = form.code2.value){
alert("%user%! Do you want really to delet your account?");
return true;<-- Here is the button which says jes-->
return false;<--but this bottun don't work-->
  }
return true
}
</script>
Title: Re: java script question
Post by: kaler on September 02, 2009, 05:39:37 PM
can nobody say me, how i can make a alert with 'ok' and 'abort'....

thank you if you did it...
Title: Re: java script question
Post by: bacter on September 02, 2009, 07:24:09 PM
use confirm() instead of alert()

Remember that this is a hfs related forum, for elementary javascript manuals google, you will find there texts in your language. ;)
Title: Re: java script question
Post by: kaler on September 02, 2009, 08:39:39 PM
jeha i know... but when i came with the macros they ask me why i don't use php  then i must say, that i must use a very good program, and then they are laughing, so i put my questions here... ( ok by javascript i can use other forums... sorry)


buit thank you for help it works fantastic...
Title: Re: java script question
Post by: rejetto on September 04, 2009, 02:41:57 PM
Code: [Select]
function validateCode(form) {
  if (form.code1.value != form.code2.value) {
      alert("%user%! The Code is wrong. Please try again.");
      return false;
  }
  return confirm('do you really want?');
}