How do I send existing e-mail and omit original recipient?

Adding JavaScript to an existing file?

  • I have an existing php page that I need to add JavaScript code to to make the zip code field numeric only and I have to have it throw an alert message when it's not numeric. I think I need to use the isNaN() function from JavaScript, but I don't know how to write it into my existing document. Can anyone help? I have pasted my existing php file here so you can see the code. Please help me. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml… <html xmlns="http://www.w3.org/1999/xhtml"> <html> <head> <script type="text/javascript"> <!-- function validate( ) { // Set the text for the error message error_message = "The following form fields are required: \n\n"; return_value = true; if ( document.signup.first.value == "" ) { error_message = error_message + "First Name \n"; return_value = false; } if ( document.signup.last.value == "" ) { error_message = error_message + "Last Name \n"; return_value = false; } if ( document.signup.email.value == "" ) { error_message = error_message + "Email \n"; return_value = false; } if ( document.signup.password.value == "" ) { error_message = error_message + "Password \n"; return_value = false; } if ( document.signup.zipcode.value == "" ) { error_message = error_message + "Zipcode \n"; return_value = false; } if ( return_value == false) { alert ( error_message ); } return return_value; } //--> </script> <title>Signup Form</title> </head> <body> <!-- Notice that the action attribute has not been specified --> <form name="signup" action="confirm.php" method="POST" onsubmit="return validate( );"> <fieldset> <legend>Signup!</legend> <label for='first'>First Name: </label><input type='text' name='first'><br/> <label for='last'>Last Name: </label><input type='text' name='last'><br/> <label for='email'>Your Email: </label><input type='text' name='email'><br/> <label for='password'>Password: </label><input type='text' name='password'><br/> <label for='zipcode'>Zipcode: </label><input type='text' name='zipcode'><br/> <input type='submit' name='submit' value='Send'> </form> </body> </html>

  • Answer:

    After the following code if ( document.signup.zipcode.value == "" ) { error_message = error_message + "Zipcode \n"; return_value = false; } Add following if ( isNaN(document.signup.zipcode.value)) { error_message = error_message + "\nZip code should be a number"; return_value = false; }

Karen at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.