Validation form code?

ok. So I have these boxes-
First Name
Last Name
E-Mail
Username
Password
Re-Type Password
I also have a register button.
I have properly linked my javascript and checked for any
mistakes but when I click the register button, I get an error
saying that I am missing parts of my form where I want an alert box
to come up instead.
Attached is my Javascript.

What does the error message say, exactly. And can we see the
HTML?
By the way,
> errorMessage += "Please enter less letters.\n";
wouldn't you want to say "Please enter fewer letters.\n"?
> errorMessage += "Please choose select a button.\n";
I have no idea what this says....
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Night_Watch" <[email protected]> wrote in
message
news:[email protected]...
> ok. So I have these boxes-
> First Name
> Last Name
> E-Mail
> Username
> Password
> Re-Type Password
>
> I also have a register button.
>
> I have properly linked my javascript and checked for any
mistakes but when
> I
> click the register button, I get an error saying that I
am missing parts
> of my
> form where I want an alert box to come up instead.
>
> Attached is my Javascript.
>
> // JavaScript Document
>
> // ---------------------- Form
> Validation ---------------------------------
> // this file will work with registration.html
>
> function validate(){
> /*this runs when the user clicks the submit button*/
> /* VARIABLES START
> var valid = true;
> var errorMessage="";
> var minLength = 3;
> var maxLength = 9;
> /*VARIABLES END-----------------------*/
>
> /* FIRST NAME START---------------*/
> var
firstName=document.getElementById("firstname").value;
> if(firstName.length < minLength){
> valid = false;
> errorMessage += "Please enter more letters.\n";
> }
> if(firstName.Length > maxLength){
> valid = false;
> errorMessage += "Please enter less letters.\n";
> }
>
> /*FIRST NAME END------------------------*/
>
> /*LAST NAME ENDS--------------------------*/
>
> var lastName=document.getElementById("lastname").value;
> if(lastName.length < minLength){
> valid = false;
> errorMessage += "Please enter more letters.\n";
> }
> if(lastName.Length > maxLength){
> valid = false;
> errorMessage += "Please enter more letters!.\n";
> }
>
> /*LAST NAME ENDS-------------------------------*/
>
> /*RADIO BUTTONS START--------------------------*/
> var format = document.myForm.format; /*this will target
the two radio
> buttons*/
> /*the variable format will actually be an array
> alert(format.length);
> alert(format[0].value);
> alert(format[1].value);*/
>
> if(format[0].checked==false &&
format[1].checked==false){
> valid = false;
> errorMessage += "Please choose select a button.\n";
> }
>
>
>
> /*RADIO BUTTONS END---------------------------*/
>
> /*CHECK PASSWORD FOR NUMBERS & LETTERS
START--------------*/
> var hasLetters = false;
> var hasNum = false;
> var passCheck =
document.getElementById("password").value;
>
>
> for(i=0; i < passCheck.length; i++){
> /*look at each letter and character ... one at a time*/
> var letter = passCheck.substr(i,1);
> if ( isNaN(letter)){
> /*isNaN checks to see if the letter is not a number*/
> /*when this is false it means we have a letter*/
>
> hasLetters = true;
> /*alert("password requires numbers and letters.");*/
> } else {
> hasNum = true;
> }
> }
>
> if (hasNum !=true){
> errorMessage += "-.-"\n"
> }
>
> if ( valid == false ){
> alert(errorMessage);
>
> }
> }
>

Similar Messages

  • In Service contract, to change the valid form date on service code level.

    Hi.
    I want to change the price valid form date on service code level ( i.e. in condition)  in Service contract.
    I know i can  do that with ME32 transaction but i have lot of Service contract with more then 10,000 line items
    Is there any way that i can change in mass based on Service contract no. wise.???
    Thanks in advance..
    Edited by: VIKRANT HANDE on Sep 15, 2009 9:11 AM

    Please check in KON* series table in SE16N transaction. I guess KOHN table may help you out. You can see other similar tables.
    In any one of the table you will find validity data.

  • Forms Code-Validation between 10g AS and windows

    i have a doubt as to what will be the forms code to validate between 10g AS and windows. This code will be used for in the case of windows authentication working between 10g AS and windows.
    I hope, my question is clear. Please help in solving the doubt.
    Regards.

    my doubt is that what will be the forms code to validate between 10g AS and windows. This code will be used for in the case of windows authentication working between 10g AS and windows. I mean to say that the code will have to be given in the my login form to validate that the user & password entered in my login-in form is the Windows user & password, if it is correct, it will allow to go to the next screen but if it is not correct, it will not allow to go to the next screen.
    regards.

  • Spry Validation form objects

    I have just been looking at the Spry validation form objects
    like the textfileds and the checkboxes etc, and I like what I see,
    but I wandered how I might deal with them once filled in and the
    form is submitted.
    Currently, I create forms manually and then use the Yaromat
    Validate form which I think is really good. I create asp pages, so
    I programme my email forms to be submitted by CDONTS. Once the form
    is submitted it is then sent to a thank you page where the CDONTS
    code is sitting, and is formatted into an email and sent to the
    relevant email addresses.
    If I chose to use Spry validation instead of the Yaromat
    Check form, do I just carry on creating the CDONTS code on the
    thank you page as I would do normally in order for the email to be
    sent?
    Thanks
    Mat

    You can specify addional error locations. See this example: http://labs.adobe.com/technologies/spry/samples/validationwidgets/Single_error_message_onS ubmit.html

  • Validating forms in jsp using javaScript

    Hi all i'm trying to validate this form with javeScript. i was testing it with just the <input type=text name= file> first. it works but after the alert message it still posts to writeXML......
    i tried putting the fuction valid() after the <form> tag but it still posts it to writeXML.jsp.......can anyone help me please........What i want to do is make sure that something is typed in all the forms befor posting to writeXML..Thanx
    <html>
    <head> <title>Create MultipleChoice Questions</title> </head>
    <script language="JavaScript">
    function valid(form) {
         if(form.file.value == "")
         alert("Please enter the file name")
    </script>
    <body bgcolor="#cccccc">
    <% int count = 0;
    String number = request.getParameter("nOfq");
    int qNumber = Integer.parseInt(number); %>
    <form action="writeXML.jsp" method="POST">
    <center>
         <table bgcolor="silver" border="1" width="75%">
         <tr align="center"><td><b>Type in the Name of your Questionnaire here eg. BlackHistory.      Dont leave any spaces between letters</b><br>
         <textarea name="file" rows="1" cols="25"></textarea><br>
         </td></tr>
    <% for(int i=1;i<qNumber+1; i++) { %>
    <%count++;%>
         <tr align="center" bgcolor="#336699"><td><b>QUESTION <%= count %>: </b><br>
         </td></tr>
         <tr align="center"><td><b>ENTER QUESTION:</b><br>
         <textarea name=<%="questionText"+i%> rows="5" cols="65"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 1:</b><br>
         <textarea name=<%="choice_1"+i%> rows="2" cols="50"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 2:</b><br>
         <textarea name=<%="choice_2"+i%> rows="2" cols="50"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 3:</b><br>
         <textarea name=<%="choice_3"+i%> rows="2" cols="50"></textarea><br>
         </td></tr>
         <tr align="center"><td><b>CHOICE 4:</b><br>
         <textarea name=<%="choice_4"+i%> rows="2" cols="50"></textarea><br><br><br>
         </td></tr>
         <tr align="center" bgcolor="#679995"><td><b>CORRECT ANSWER:</b><br>
         <textarea name=<%="cAnswer"+i%> rows="2" cols="50"></textarea><br><br><br>
         </td></tr>
    <% } %>
    <tr>
    <td align="center"><input type="submit" name="next" value="NEXTT" onClick="valid(this.form)">
    <td align="center"><input type="hidden" name="qCount" value="<%=count+1%>">
    </td></tr>
    </table>
    </center>
    </form>
    </body>
    </html>

    this Corrected code works perfectly
    <html>
    <head> <title>Create MultipleChoice Questions</title> </head>
    <script language="JavaScript">
    function valid(form) {
    if(form.file.value == ""){
    alert("Please enter the file name");
    frmValid.file.focus();     
    }else{
         frmValid.action="writeXML.jsp";
         frmValid.submit();
    </script>
    <body bgcolor="#cccccc">
    <% int count = 0;
    int qNumber=-1;
    String number = clearNull(request.getParameter("nOfq"));
    if(! number.equals(""))
    qNumber = Integer.parseInt(number);
    %>
    <form name="frmValid" method="POST" >
    <center>
    <table bgcolor="silver" border="1" width="75%">
    <tr align="center"><td><b>Type in the Name of your Questionnaire here eg. BlackHistory. Dont leave any spaces between letters</b><br>
    <textarea name="file" rows="1" cols="25"></textarea><br>
    </td></tr>
    <% for(int i=1;i<qNumber+1; i++) { %>
    <%count++;%>
    <tr align="center" bgcolor="#336699"><td><b>QUESTION <%= count %>: </b><br>
    </td></tr>
    <tr align="center"><td><b>ENTER QUESTION:</b><br>
    <textarea name=<%="questionText"+i%> rows="5" cols="65"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 1:</b><br>
    <textarea name=<%="choice_1"+i%> rows="2" cols="50"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 2:</b><br>
    <textarea name=<%="choice_2"+i%> rows="2" cols="50"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 3:</b><br>
    <textarea name=<%="choice_3"+i%> rows="2" cols="50"></textarea><br>
    </td></tr>
    <tr align="center"><td><b>CHOICE 4:</b><br>
    <textarea name=<%="choice_4"+i%> rows="2" cols="50"></textarea><br><br><br>
    </td></tr>
    <tr align="center" bgcolor="#679995"><td><b>CORRECT ANSWER:</b><br>
    <textarea name=<%="cAnswer"+i%> rows="2" cols="50"></textarea><br><br><br>
    </td></tr>
    <% } %>
    <tr>
    <td align="center"><input type="submit" name="next" value="NEXTT" onClick="valid(this.form)">
    <td align="center"><input type="hidden" name="qCount" value="<%=count+1%>">
    </td></tr>
    </table>
    </center>
    </form>
    </body>
    </html>
    <%!
    private String clearNull( String sField ) {
    return ( sField == null ) ? "" : sField;
    %>

  • Error "10000180 Specify valid tax code" after upgrading 2007 to 8.8 PL15

    Hi all,
    In one client, I've upgraded the database from 2007 to 8.8 PL15.
    When I try to add an Invoice or Sales order in 8.8, the system gives an immediate error "10000180  Specify valid tax code" and does not open the standard Invoice form to add a new document.
    The same happens when I select other sales or purchase menu options.
    I checked the tax definition (VAT table) and everything seems fine.
    Does anybody know what can cause this error?
    It must be related with 8.8 version, since in 2007 it worked fine...
    Thanks all,
    Manuel Dias

    Hi Syed,
    After some long checks, I've discovered the problem: after the upgrade, the VTG1 table had wrong value keys (01, 02, 03 and 04) against the OVTG table (which was 1,2,3 and 4).
    I've done a manual update of this entries and then it worked.
    Thanks anyway,
    Manuel Dias
    Edited by: Manuel Dias on Mar 28, 2011 9:46 PM
    Edited by: Manuel Dias on Jun 21, 2011 10:04 AM

  • Common Validation Fileds Code?

    Hi All,
    I Need Validation Fields Code.
    Some Of Scenario's Are As Follows.
    1.InputFields-Only Numeric
    2.InputFields-Only Character.
    3.InputField- Fixed value
    4.Button-True[TABLE1 Execution],False[Table2 Execution].
    And How to use Guard Condition For Submit Button And What Code I Will write.
    if you have Any SomeOther Common Inputfields Code.
    Please Send ASAP.
    Thanks & Regards
    SubbaRao Chinta

    Hi,
    Guard condition of any form or table is used to avoid the excution if some conition is invalid.
    Ex.
    validation condition for Layers will avoid the navigatio from one layer to other if the input form is empty.
    Regards,
    Govindu

  • Define valid tax code

    Gurus,
    While posting a vendor invoice through fb70, i am trying to assign the valid tax code.
    But when i put in the tax code it is not accepting it.
    My tax code is not showing up in the list.
    i have checked the following steps for the tax configuration:
    a) DEFINED TAX CODE FOR SALE AND PURCHASE FTXP
    b) CREATE A PURCHASE A/C FS00
    c)CREATE A VAT INPUT A/CFS00
    d) DEFINE TAX A/COB40

    hi friend
    please check the following steps in your configuration for TDS if these steps are configured properly you wont get any error.
    1.Check W.Tax Countries
    2. Define Official Witholding Tax Codes
    3. Define Business Place (If more than one TAN No.)
    4. Assign factory calendar to Business Place
    5.Define W.Tax type for Invoice Posting and Payment Posting
    6. Define W.Tax Code for Invoice Posting and Payment Posting
    7.Check Receipiant Types
    8. Maintain Tax due dates
    9. Maintain surcharge calculation method
    10.Maintain Surcharge rates
    11.Assign tax types to company code
    12. Create GL Account - Withholding tax
    13. Assingment of GL Account to Withhold tax
    14. Maintain Document types for challan updatation
    15.Maintain Number ramges group (SAP script forms)
    16.Assign Number ranges to number group
    17. Maintain number ranges
    18. Assign TDS Number in Global Parameters
    19. Assign Tax codes in Vendor Master
    kind regards
    Arman
    SAP FICO

  • Please enter valid Security Code

    My iTunes account wont let me download any apps or update them either because it says that my security code for my card is wrong. I have reentered everything about the card including the security code and it still keeps saying "Please enter valid security code". I'm looking at the security code and I dont know what to do about it. I was going to try and email Apple about it but I cannot find an email address for them and its complicated trying to contact them. How to do I fix this problem or email Apple about it?

    Have a look here  >  http://support.apple.com/kb/TS1646
    And there is this...
    Contact iTunes Customer Service
    Apple  Support  iTunes Store  Contact Us

  • I am trying to add a new credit card and it keeps telling me that I have to enter a valid security code...I have tried 2 different cards and it is doing the same thing. How do I get past this?

    I guess it has been a year since I last purchased something on I-tunes and my account is saying that they couldn't authorize my card for some of my purchases.  I am trying to add a new credit card to clear this up and it keeps saying that I have to enter a valid security code.  I have tried 2 different cards and I get the same thing.  I have also added an I-tunes gift card and that isn't clearing up the money that I owe.  It is showing that I have a $25 credit for that.  How do I fix this, I have been trying for days and all I have got from the e-mail tech support is that its my credit card issuer that is causing the problem.  Thats not correct because one of the credit cards that I am trying to use, is a prepaid Visa gift card.  I know that these work on I-tunes because I have used them before in the past.  I am getting very frustrated with this whole process, I just want to clear up my account and buy some new music!! HELP!!

    You probably ran into blocks & locks.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html
    They'll sort it out.

  • Keep getting an error message when trying to send some texts to valid numbers, "Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code.

    Does anyone know why I keep getting an error  message, "Error invalid number. Please re-send using a valid 10 digit mobile number or valid short code.  The numbers I'm texting to, are valid numbers.

    Did you ever get resolution to this problem?
    My coworker has the identical issue, including the number (+1 (1)(216)116-11) in the error reply.

  • Having problem buying online.need your help since it's my first time here.apple is asking for my billing address but when i enter my address here in qatar,it's saying i should enter a valid zip code within the u.s.does it mean i can't buy online

    having problem buying online.need your help since it's my first time here.apple is asking for my billing address but when i enter my address here in qatar,it's saying i should enter a valid zip code within the u.s.does it mean i can't buy online even if it wil be shipped within u.s. only?

    To buy in for delivery in Qatar, you should be starting from the Apple Qatar site:
    http://www.apple.com/qa/
    Do you have an Apple-ID? if you do, then you should not have to enter your Address again, and may be able to sidestep the US Zip Code issue.

  • I have a new iPhone 5 and receive the following message when texting some people within my contacts.  Message sent using invalid number of digits please resend using 10 digit number or valid short code Msg:2114

    I have a new iPhone 5 and receive the following message when texting some people within my contacts.  Message sent using invalid number of digits please resend using 10 digit number or valid short code Msg:2114. Online I found a discussion that stated i needed to delete contact and re-add. I have done that to no avail. Any ideas?

    I had the same issue with the iPhone 6 and tried everything!  I now understand that at some point I stored a number for a contact without including the area code and sent a text message.  So, to correct the issue, you must literally "erase" all references to the contact, not just the number.  Deleting the contact and entering a new one is not enough because the iPhone stores references to that number in multiple places.  The steps below worked and are very simple:
    1) On the contact screen, delete everything stored for that number.  You can't just edit the contact to fix the problem, so write down or record the info somewhere before you complete this step.  Choose edit and then select DELETE to eliminate the entire contact which means home, work, cell, email address, etc.
    2) Delete the entire string of messages you sent to that number.  That's every single message...
    3) Now delete the entire string of invalid 2114 messages you received after your text(s) failed.
    4) Finaly, remove the contact from FAVORITES if you saved it that way. 
    5) To validate that all this worked, simply go to the keypad or contact screen and enter the number associated with the contact to verify successful removal.  I used the keypad and dialed to confirm.  If the contact number still shows up, you need to go back and recheck your steps.  Trust me, I had to do this a few times.
    Several posts suggested that you should  reset and turn off your phone.  After following these steps, it was not necessary for me to reset or turn off my device. 
    is there a much faster way to achieve the same results?  Probably, but this was safe for an iPhone novice and may help you avoid inadvertently deleting other contacts or replacing factory settings that you need.  

  • Mail to Form Code Confussion

    Hello everyone. I am having an issue with my Mail to Form code. It's not so much a technical one (I don't think it is anyway) It's mostly I don't understand what information to plug into a couple parts. I will post the code here (leaving out everything before the "body") and hopfully some one can help me out.
    <body>
    <div class="style1" id="apDiv1">Call Request Form</div>
    <div id="apDiv2">
      <div align="center">Please fill out this form and a Beta Test Studios represenetive will contact you as soon as possible. Thank you.</div>
    </div>
    <div id="apDiv3">
      <div align="center"><strong>Please tell us wher you heard about Beta Test Studios</strong></div>
    </div>
    <FORM METHOD=POST ACTION="[email protected]" ENCTYPE="text/plain">
    <table width="311" height="480" border=0 cellpadding=20 cellspacing=0>
    <tr>
    <td height="327"><font size=2 face="arial" color="#000000">
    <input type="text" name=Name size=27 />
    :Name<BR>
    <INPUT type="text" name=Phone size=27 id="Phone">
    :Phone<BR>
    <INPUT type="text" name=Call time size=27 id="Call time">
    :Time to Call<BR>
    <INPUT type="text" name=email size=27> :E-mail
    </font></td>
    </tr>
    <tr>
    <td width="230" height="62">
    <SELECT name="choices" size=1>
    <OPTION selected> Please Choose
    <OPTION> Google
    <OPTION> Yahoo!
    <OPTION> Newspaper/Magazine
    <OPTION> Word of mouth
    <OPTION> Other
    </SELECT></td>
    </tr>
    <tr>
    <td height="91">
    <font size=1 face="arial" color="#000000">
    <center>
    <INPUT NAME="redirect" TYPE="hidden" VALUE="index.html">
    <INPUT NAME="NEXT_URL" TYPE="hidden" VALUE="index.html">
    <INPUT type=submit value="Send">
    <INPUT type=reset value="Clear">
    </center></td></tr></table>
    </FORM>
    <!-- ** END OF FORM ** -->
    </body>
    </html>
    I am having a problem understanding exactly what I am supposed to put here near the very bottom after <INPUT NAME="redirect" TYPE="hidden" VALUE=    and after <INPUT NAME="NEXT_URL" TYPE="hidden" VALUE=    I know that I am supposed to replace the "index.html" part in both lines I am not sure what I am supposed to replace it with. Any help would be appreciated. Thanks so much.

    Hi,
    What are you trying to do exactly?  If you would like to make a piece of text link to a mailto code where, if clicked, it will automatically open up that person's email with a blank email page with u as the receiver, then all you have to do in Dreamweaver is..
    1.  Highlight all the text you want the link to the email to be.
    2. Go to the "link" window in the properties panel under the main viewing window
    3. Type in "mailto:youremailhere" without the quotes of course and that will create the link I believe you might be looking for.
    If this is not the nature of your problem please be more descriptive.

  • B2B-51507 Element GS08 does not contain a valid identification code

    Hi,
    I am getting error
    Machine Info: (local.example.com) Element GS08 (Version / Release / Industry Identifier Code) does not contain a valid identification code: '004010UCS' is not allowed. Segment GS is defined in the guideline at position N/A.{br}{br}This error was detected at:{br}{tab}Segment Count: 1{br}{tab}Element Count: 8{br}{tab}Characters: 155 through 164
    Data I am getting looks fine:
    ISA*00* *00* *08*9269070010 *12*7162545222 *120224*0752*U*00401*100000046*0*T*>~GS*FA*8022574371*7162545222*20120224*0752*1046*T*004010UCS~ST*997*1046~AK1*OG*1762~AK2*875*4225~AK5*A~AK2*875*4226~AK5*A~AK9*A*2*2*2~SE*8*1046~GE*1*1046~IEA*1*100000046~
    I have my agreement configured for UCS version 4010. The value in GS 08 is the expected one.
    I even tried to hardcode value 004010UCS at partner document level useinf Override parameter but still getting same error.
    We are working on B2B version 11.1.1.3
    Thanks,
    Deepti

    Hi Anuj,
    When I applied InterchangeUCS and GroupUCS file as suggested.
    I have received more errors:
    Error Code     B2B-51507
    Error Description     Machine Info: (lfimt03.dataintensity.com) Element ISA07 (Interchange ID Qualifier) does not contain a valid identification code: '12' is not allowed. Segment ISA is defined in the guideline at position N/A.{br}{br}This error was detected at:{br}{tab}Segment Count: 1{br}{tab}Element Count: 7{br}{tab}Characters: 51 through 53 Element ISA12 (Interchange Control Version Number) does not contain a valid identification code: '00401' is not allowed. Segment ISA is defined in the guideline at position N/A.{br}{br}This error was detected at:{br}{tab}Segment Count: 1{br}{tab}Element Count: 12{br}{tab}Characters: 84 through 89
    My input data is:
    ISA*00* *00* *08*9269070010 *12*7162545222 *080605*1009*U*00401*000202835*0*P*>~GS*FA*8022574371*7162545222*20080605*1009*000202835*T*004010UCS~ST*997*202835001~AK1*OG*5363~AK2*875*24348~AK5*A~AK2*875*24349~AK5*A~AK2*875*24350~AK5*A~AK2*875*24351~AK5*A~AK9*A*4*4*4~SE*12*202835001~GE*000001*000202835~IEA*00001*000202835~

Maybe you are looking for

  • Can't connect my iphone with macbook air

    Updated both my iphone 5s and my MacBook Air with latest software and was so excited to start using handoff, but it´s just not working. Maybe there´s someone who can help me and guide through all this.

  • "interface" datatype variable??

    While working with other people's Code I found the following: <code> public interface iMyClass //the interface public static string str = ""; public void setStr(String sStr); </code> and in the same package: <code> public class MyClass //the class pr

  • Constant crashes iPhoto '09

    Last month or so, iPhoto '09 totally unstable (was always fine before!) Now crashes on opening or with the very first try. Couldn't import a .avi file either. I'm wondering if it's memory related. I trashed the preference file and rebooted, but didn'

  • QuickTime runs poorly on iBook G4

    I'm writing about my old iBook G4, which is running 10.4.11. No QuickTime movie will run well. Running Safari 4.0.5 and Quicktime 7.6.4. Any thoughts?

  • HT201328 Cannot unlock my iphone 3gs.

    I cant unlock my iphone 3gs. I have requested to unlock thru o2 and have reieved email confirming from apple that my iphone has been set to unlock. I have tried every options and still unable to unlock my phone, can anyone please help me. Thanks.