rejetto forum
May 25, 2012, 09:51:26 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: java script question  (Read 448 times)
0 Members and 2 Guests are viewing this topic.
kaler
Experienced poster
***
Offline Offline

Germany Germany

Posts: 94


View Profile
« on: September 01, 2009, 10:51:38 AM »

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:
<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>
Logged
kaler
Experienced poster
***
Offline Offline

Germany Germany

Posts: 94


View Profile
« Reply #1 on: September 02, 2009, 12:39:37 PM »

can nobody say me, how i can make a alert with 'ok' and 'abort'....

thank you if you did it...
Logged
bacter
Operator
Insane poster
*****
Offline Offline

Spain Spain

Posts: 679


View Profile
« Reply #2 on: September 02, 2009, 02: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. Wink
Logged

your computer has no brain - use your own !
kaler
Experienced poster
***
Offline Offline

Germany Germany

Posts: 94


View Profile
« Reply #3 on: September 02, 2009, 03: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...
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11830


View Profile
« Reply #4 on: September 04, 2009, 09:41:57 AM »

Code:
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?');
}
« Last Edit: September 04, 2009, 09:43:43 AM by rejetto » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 15, 2012, 12:55:01 PM
anything