Javascript to validate a percentage

Hello,
Any one knows a way to vaidate that the number entered in
text box is either a 1 or a percent. I have been trying to validate
this using javascript and its not working.
Please help

I have put <cfinput> validate as a float, that took
care of that problem. But now when I validate with the regular
script, it does not return back to the error form. Did I mention
that this is flash forms..
See code below..
<cfsavecontent variable="Test">
var varExpressedAs = displayid.value;
var blnGreaterZero = (rangefloor.text
>0)&&(rangeceiling.text >0)
var blnEqualZero =
(rangefloor.text==0)&&(rangeceiling.text ==0)
<!--- THE FORM IS SET UP TO VALIDATE ON NUMBERS,
SO NO NEED TO VALIDATE WITH JS HERE --->
<!--- ATLEAST A VALUE HAD TO BE GREATER THAT ZERO --->
if (blnEqualZero)
alert('Enter a value in the Range or Celing form!', 'Alert',
mx.controls.Alert.OK);
if (blnGreaterZero)
alert('You can only enter one value in either the Range or
Ceiling form', 'Alert', mx.controls.Alert.OK);
if (varExpressedAs==1)
if ((rangefloor.text > 1)||(rangeceiling.text>1))
alert('The values entered has to be greater or eqaul to 1',
'Alert', mx.controls.Alert.OK);
if (varExpressedAs >1)
if ((rangefloor.text < 0)||(rangeceiling.text < 0))
alert('The values entered has to be percentages are not
allowed', 'Alert', mx.controls.Alert.OK);
</cfsavecontent>

Similar Messages

  • How to use Javascript to validate values....

    Hello :
    I have the following piece of code in my jsp
    <script>
    function doSubmit()
    if (!validate())
    return;
    document.create_request.action="ibu_conf_sr.jsp;
    document.create_request.submit();
    function validate()
    with (document.create_request) {
    if (document.create_request.sei_summary.value == '') {
    alert('Please enter Summary');
    return false;
    </script>
    <form method="post" name="create_request" action="ibu_cr_sr.jsp" >
    <tr>
    <td align="right" valign="top" nowrap>  </td>
    <td align="left" valign="top" nowrap>  
    <!--input type="submit" name="search" value="Submit Service Request"-->
                   <input type="button" value="Submit" onClick="doSubmit()">
    <input type="reset" name="Clear3" value="Clear">
    </td>
    <td width="13%"> </td>
    </tr>
    </form>
    I have a Submit button which will trigger the Java script doSubmit which in turn should Validate the values for one of the fields in the form ibu_cr_sr.jsp and only if the field has a value should it forward to the next page, ibu_conf_sr.jsp
    For some reason I am not able to get this to work.. what am I missing ?

    That's funny because it works for me. Cut and paste the following into a text file, name it test.html and open in IE. then try it.
    <html>
    <head>
    </head>
    <body>
    <script>
    function doSubmit()
    if (!validate()) { return false; }
    document.create_request.action="ibu_conf_sr.jsp"; //Added "
    document.create_request.submit();
    function validate()
    if (document.create_request.sei_summary.value == "") {
    alert('Please enter Summary');
    return false;
    return true;
    </script>
    <form method="GET" name="create_request"  >
    <input type=text name="sei_summary">
    <tr>
    <td align="right" valign="top" nowrap> </td>
    <td align="left" valign="top" nowrap>
    <!--input type="submit" name="search" value="Submit Service Request"-->
    <input type="button" value="Submit" onClick="doSubmit()">
    <input type="reset" name="Clear3" value="Clear">
    </td>
    <td width="13%"> </td>
    </tr>
    </form>
    </body>
    </html>

  • Validate phone type fields by JavaScript

    Hello.
    I'm using JavaScript to validate some fields on Contact entity like the date of birth. Erevything is working very well. To do that we use the name of the object on the source code of the web page for example "ContactEditForm.Date of Birth". But when we try to validate the phone type fields using the same method, the JavaScript doesn't work because all of them have symbols on the name ("ContactEditForm.Fax Phone &#35", "ContactEditForm.Assistant Phone &#35", "ContactEditForm.Cellular Phone &#35"). We need to use these fields, so we can't change them. And we must validate them before the user clicks on save buttom, so we are using JavaScript on the Global Web Applets. How can we reference these exactly fields on JavaScript code to validade them on Global Web Applets? Can anybody help me?
    Thanks in advance.

    Hello Royston,
    This is part of the code that I use to reference the fields of phone number.
    //Try 1: document.getElementById("ContactEditForm.Fax Phone #;").onkeypress = new Function('limpaTelefone(this);');
    //Try 2: document.getElementById("ContactEditForm.Home Phone #").onkeypress = new Function('limpaTelefone(this);');
    Thanks for your help.

  • Is there any way of  using arrays or vectors in JavaScript

    In my JSP page when ever a value in the text field changes i have to store that value before submitting a form. When ever the value in the text field changes i have to use "OnChange" option but i have to store all these values in an array or vector. Is there any other way of doing this. I am using webwork. Can any one help me!!!!!!

    JavaScript arrays are dynamic. You can add new values to the array and the array will grow in size.
    //a is an array of size zero
    var a = new Array();
    a[0] = "something";
    a[1] = "else";
    a[a.length] = "Adding another String at the end of my array";But here's something to think about. If your web site absolutely needs JavaScript, what happens to your site when the user decides to disable JavaScript in his browser....?
    I only use JavaScript to validate the user's input data, but I revalidate server-side in case JavaScript was disabled.

  • Sharepoint throw a javascript error while adding items to sharepoint list

    sharepoint throw javascript error when adding item to list
    error called:  this._registeredValidators[validatorIdx].Validate is not a function
    any help please

    Hi,
    If you want to validatelist column, there is out of the box way to accomplish this with SharePoint
    There's a great blog that covers how to validate Strict Text Formats:
    http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-strict-text-formats-in-sharepoint-2010/
    In addition, we can use JavaScript to validate column. Please make sure you use the code correctly.
    More information:
    http://chrisstahl.wordpress.com/2011/02/06/validate-a-sharepoint-list-column-with-regular-expression/
    http://blog.tallan.com/2013/09/16/how-to-add-custom-validation-logic-to-validate-a-phone-field-in-sharepoint/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Client Side Javascript Validation not Working in Struts 1.x version

    hi,
    I'm following the steps provioded in the below link for Javascript Client side validation but still it is not working.I'm struggling to get this work.
    [http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/|http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/]
    "The framework automatically generates the browser specific JavaScript and validate the data only at the client side."From the above statement i undertstand that framework itself generates the javascript function for validating the field mentioned in validations.xml file so that we dont have to explicitly write a javascript function for
    validating the fields
    (or)
    Do we need to call an explicit function
    Please need help on this.
    I have followed all the steps mentioned on the above link but Client Side Javascript Validation not Working in Struts 1.x version....
    Thanks and Regards,
    Deepak

    Hi,
    Please find my steps below....still getting an error.
    2> which version of commons-validation.jar needs to be downloaded ...Link please
        downloaded the latest commons-validation.jar and placed in lib.refreshed the project,and did a build.
        3> which DTD name to be specified in "validator-rules.xml" which is in accordance to commons-validator.jar file.
    validator-rules.xml ::
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">validation.xml:
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    i did as u said and im gettiong the below errorNov 5, 2009 4:33:08 PM org.apache.struts.validator.ValidatorPlugIn initResources
    SEVERE: Invalid byte 2 of 2-byte UTF-8 sequence.
    org.apache.commons.digester.xmlrules.XmlLoadException: Invalid byte 2 of 2-byte UTF-8 sequence.
         at org.apache.commons.digester.xmlrules.FromXmlRuleSet.addRuleInstances(FromXmlRuleSet.java:139)
         at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610)
         at org.apache.commons.digester.xmlrules.DigesterLoader.createDigester(DigesterLoader.java:89)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:122)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:238)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:181)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1036)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
         at javax.servlet.GenericServlet.init(GenericServlet.java:212)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
         at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:448)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Need help forum members.....
    Please reply to my question 1  which has been asked before as belowDo i need to write explicit javascript function for validation in Struts (or) struts generates the javascript function by itself.??? Please explain with an example....
    Edited by: Deepak_A_L on Nov 5, 2009 4:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Javascript focus() is not working anymore in firefox 22, thank You

    With this sample code, focus() is not working
    <pre><nowiki>Name <input name=cName id=cName size=50 onblur=chkName(); />
    <br>
    Last Name: <input name=cLastName id=cLastName size=50 onblur=chkLastName(); />
    <br>
    Another Field:
    <input name=cAnother id=cAnother size=15 />
    <script>
    function chkName() {
    var cName = document.getElementById('cName').value;
    if ( cName == '' ) {
    alert("ERROR");
    document.getElementById('cName').focus();
    function chkLastName() {
    var cLastName = document.getElementById('cLastName').value;
    if ( cLastName == '' ) {
    alert("ERROR");
    document.getElementById('cLastName').focus();
    </script></nowiki></pre>

    Yes of course.
    The function example I posted would be called by the onblur event and not by a submit. as has been stated previously, I also remember that it used to work. Perhaps I am wrong.
    Since that is not working, I am suggesting that the OP will be forced to use the onsubmit and validate at that time to solve the problem as was also previously suggested. Using the onSubmit and returning false on invalid does work for me.
    Since my last post I did determine that I can pass the id to a window.settimeout and have it work correctly, but this still does not stop the form from being posted in FireFox. Whereas an onblur navigation cancellation does prevent posting in Chrome and IE.
    this is important to note because if you are depending on your javascript to validate your data you can get betray because not all the browsers treat it the same way. This is by no means a FireFox only problem. they all have their quirks.
    I just wish there was a standard that we could depend on.

  • Using Javascript form validation in WordPress - Firefox issues

    I have been struggling for a while to get javascript to validate a WordPress based HTML form which uses radio buttons. I finally came up with a solution with was a bit long-winded but worked - at least in IE and Chrome - however, it doesn't work in Firefox (which suggests my code is a bit sloppy). I think my radio button reference is the issue. Can anyone help with what I have done wrong - apart from use an inefficient approach for validation :-)?
    A simplified version of my form:
    <script>
    function validateForm()
    var aa=document.forms["personalise"]["motivation"]["1a"];
    var ab=document.forms["personalise"]["motivation"]["1b"];
    var ac=document.forms["personalise"]["motivation"]["1c"];
    var ad=document.forms["personalise"]["motivation"]["1d"];
    var ae=document.forms["personalise"]["motivation"]["1e"];
    if (!(aa.checked == true || ab.checked == true || ac.checked == true || ad.checked == true || ae.checked == true))
    alert("Question 1 must be completed");
    return false;
    </script>
    <form name="personalise" action="insertdatatest.php" onsubmit="return validateForm()" method="post">
    1. Are you seriously planning to quit </b>:&nbsp;&nbsp;
    <input id="1a" type="Radio" title="" name="motivation" value="1" /> Within the next 2 weeks
    <input id="1b" type="Radio" title="" name="motivation" value="2" /> Within the next 30 days
    <input id="1c" type="Radio" title="" name="motivation" value="3" /> Within the next 3 months
    <input id="1d" type="Radio" title="" name="motivation" value="4" /> No, I am not currently planning to quit
    <input id="1e" type="Radio" title="" name="motivation" value="5" /> I have already quit
    <input type="submit" value = "Submit">
    </form>
    For My Website : http://www.schoolanduniversity.com

    Thanks for your support,
    This will partly solve the issue I think. Now, the validation is indeed only done for the first form. But I need to save data twice when entering data in the second grid. When checking the error console in mozilla I see following error:
    Error: grid[r] is undefined
    Which is reffering to:
              if ((grid[r] [1] != missing) ||(grid[r][2] != missing) || (grid[r][3] != missing))
    When I save again, the data will be saved without this error.
    Is there a way to exclude the second grid in the if Statement?
    Regards,
    Erik

  • Javascript hel - how to limit date selection ?

    I  use the following javascript to validate a start and end date, and radio buttons on my form. What I need to do is limit the date selection to 30 days only. Anything more should display an error. So if I enter starting date of 1/1/2009 and ending date of 2/28/2009, then I should get a popup error. How can I do this with my exisintg code :
    <Script language="JavaScript">
      function validateForm()
    if(document.indexForm.startDate.value == "" && document.indexForm.endDate.value == "")
        alert('Start Date and End Date cannot be blank.');
        indexForm.startDate.focus();
        return(false);
    if(document.indexForm.startDate.value > document.indexForm.endDate.value)
        alert('End Date cannot be less than Start Date.');
        indexForm.endDate.focus();
        return(false);
    if(document.indexForm.startDate.value !== "" && document.indexForm.endDate.value == "")
        alert('End Date cannot be blank.');
        indexForm.endDate.focus();
        return(false);
    if(document.indexForm.startDate.value == "" && document.indexForm.endDate.value !== "")
        alert('Start Date cannot be blank.');
        indexForm.startDate.focus();
        return(false);
    myOption = -1;
        for (i=indexForm.region_code.length-1; i > -1; i--) {
        if (indexForm.region_code[i].checked) {
        myOption = i; i = -1;
        if (myOption == -1) {
        alert("Please select a region.");
         return(false);
    myOption = -1;
        for (i=indexForm.reportName.length-1; i > -1; i--) {
       if (indexForm.reportName[i].checked) {
       myOption = i; i = -1;
        if (myOption == -1) {
       alert("Please select a report.");
         return(false);
    return(true);
    </Script>

    Step 1.  Get rid of anything that can be done with a cfinput tag and the built in js that comes with it.
    Step 2 - js is reading strings, not dates from your text boxes.  Convert these to dates before you start comparing the values to each other.

  • Javascript validation before MM_insert

    I'm using Dreamweaver CS4, an ASP website and an Access database. I'm using the Dreamweaver generated code to manage the database update. I would like to use Javascript to validate the form before the MM_insert. Nothing I've tried works - the Javascript is completely ignored.
    Here is the insert code:
    <%
    If (CStr(Request("MM_insert")) = "needavailadd") Then
      If (Not MM_abortEdit) Then
        ' execute the insert
        Dim MM_editCmd
        Set MM_editCmd = Server.CreateObject ("ADODB.Command")
        MM_editCmd.ActiveConnection = MM_eventCalendar_STRING
        MM_editCmd.CommandText = "INSERT INTO needAvail (naType, memName, city, [state], phone, email, info, eventID) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
        MM_editCmd.Prepared = true
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 3, Request.Form("naType")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 32, Request.Form("memName")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 18, Request.Form("city")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 2, Request.Form("state")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 12, Request.Form("phone")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 48, Request.Form("email")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 202, 1, 75, Request.Form("info")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 5, 1, -1, MM_IIF(Request.Form("eventID"), Request.Form("eventID"), null)) ' adDouble
        MM_editCmd.Execute
        MM_editCmd.ActiveConnection.Close
        End If
    End If
    %>
    Should the validation code be inserted after the "Then" or called from there or someplace else? Any help would be appreciated.

    I'm using Dreamweaver CS4, an ASP website and an Access database. I'm using the Dreamweaver generated code to manage the database update. I would like to use Javascript to validate the form before the MM_insert. Nothing I've tried works - the Javascript is completely ignored.
    Here is the insert code:
    <%
    If (CStr(Request("MM_insert")) = "needavailadd") Then
      If (Not MM_abortEdit) Then
        ' execute the insert
        Dim MM_editCmd
        Set MM_editCmd = Server.CreateObject ("ADODB.Command")
        MM_editCmd.ActiveConnection = MM_eventCalendar_STRING
        MM_editCmd.CommandText = "INSERT INTO needAvail (naType, memName, city, [state], phone, email, info, eventID) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
        MM_editCmd.Prepared = true
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 3, Request.Form("naType")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 32, Request.Form("memName")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 18, Request.Form("city")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 2, Request.Form("state")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 12, Request.Form("phone")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 48, Request.Form("email")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 202, 1, 75, Request.Form("info")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 5, 1, -1, MM_IIF(Request.Form("eventID"), Request.Form("eventID"), null)) ' adDouble
        MM_editCmd.Execute
        MM_editCmd.ActiveConnection.Close
        End If
    End If
    %>
    Should the validation code be inserted after the "Then" or called from there or someplace else? Any help would be appreciated.

  • Javascript reading a protected / hidden page item / application item

    Hi
    I'm trying to use javascript to validate / calculate the value of a page item.
    For this I need to access an item that is it protected (not simply a text field which is editable) - or one which is currently hidden.
    Is it possible for javascript to read the value of an application item or a page item that is hidden or a page item that is protected (not editable)?
    Thanks in advance.
    Mike

    Mike, when you change the item type you are changing the html element type
    from
    <input type="text" id="P1_ONE" value="This is P1_ONE item type value" />
    to something like
    <td>This is P1_ONE item type value</td>
    for the text type you would use .value so $('P1_ONE').value or document.getElementById('P1_ONE'). value but for the "display as text" would be $('P1_ONE').innerHTML or document.getElementById('P1_ONE').innerHTML.
    been a while since i use APEX js systax as I've been using jquery but the second example of each type will work.

  • Accessing a arraylist in javascript

    Hi
    can anyone tell me how to access araraylist
    <table class="tableborder">
    <tr class="subtablerow2"><td class="boldtext">Total Marks : <bean:write name="courseCriteriaForm" property="totalMarks"/> </td>
    <td class="boldtext">Passing Marks : <bean:write name="courseCriteriaForm"property="passingMarks"/></td>
    </tr>
    </table>
    <table class="tableborder">
    <logic:iterate id="StudentListmarks" name="courseCriteriaForm" property="StudentListmarks" >
    <tr>
    <td>
    <bean:write name="StudentListmarks" property="userinfo_id"/>
    </td>
    <td>
    <bean:write name="StudentListmarks" property="firstname"/>
    </td>
    <td>
    <bean:write name="StudentListmarks" property="lastname"/>
    </td>
    <td>
    <html:text name="StudentListmarks" property="marks" indexed="true" />
    </td>
    <td>
    <html:text name="StudentListmarks" property="remarks" indexed="true"/>
    </td>
    </tr>
    </logic:iterate>
    </table>
    <div align="center"><html:submit styleClass="button" onclick=" return validate(this.form,StudentListmarks);"/><html:cancel styleClass="button" /></div>
    here is my javascript:
    function validate(form,myarraylist){
    alert("in the function........");
    for(var i=0;i<myarraylist.lenght;i++){
    alert("here....");
    return false;
    can any1 help me in validating marks by javascript

    a) Use formatting to display code
    b) dont use things like any1 , Why should people bother to help you if your question isent important enoigh to type 2 letters more ?
    c) As far as i know JavaScript does not have a build in ArrayList object

  • Javascript SSN validator...

    Hi everyone,
    I am looking for a javascript which validates the format of SSN
    If i have to enter SSN in a text field
    1.It has to accept only numbers (no characters)
    2.It has to add the string '-' automatically when the users entering the SSN
    3.It has to validate whether users entered correct no of digits (9 digits)
    Does anyone encountered or implemented such kind of javascript validations for a SSN no?
    Please let me know if this is possible to do
    Thank you
    phani

    Hi everyone,
    I am looking for a javascript which validates the
    format of SSN
    f i have to enter SSN in a text field
    1.It has to accept only numbers (no characters)
    2.It has to add the string '-' automatically when
    the users entering the SSN
    3.It has to validate whether users entered correct no
    of digits (9 digits)
    Does anyone encountered or implemented such kind of
    javascript validations for a SSN no?
    Please let me know if this is possible to do
    Thank you
    phaniUsing google the following link(s) comes up:
    http://javascript.internet.com/forms/val-ssn.html
    http://www.yaldex.com/FSForms/ValidationSocialSecurityNumber.htm
    http://blog.techsaints.com/2007/06/03/javascript-social-security-number-validation/
    Thank you,
    Tony Miller
    Webster, TX

  • Help validating param fields with Javascript

    Hi,
    Rpt Escapes: B4 Form Values, I added a javascript that validates the entered date_ranges(date_from -- date_to) -- must not be > 30 days. If I used that javascript in one of the param fields (web_settings:: Additional HTML = onChange="show_alert(this.form)") -- it works. but I need to put that alert when the user clicks the submit button, so in the Rpt Escapes:: Before Form Value, I changed this:
    <body dir=&Direction bgcolor="#ffffff">
    <form method=post action="_action_"> ** CHANGED THIS TO:
    <form method=post action="_action_" onSubmit="return show_alert(this.form);">
    <input name="hidden_run_parameters" type=hidden value="_hidden_">
    <font color=red><!--error--></font>
    <center>
    <p><table border=0 cellspacing=0 cellpadding=0>
    <tr>
    <td><input type=submit></td>
    <td width=15>
    <td><input type=reset></td>
    </tr>
    </table>
    <p><hr><p>
    --- but it's not working. any ideas?
    thanks!!!

    Hello,
    I have tried with the following code (Source HTML of the parameter form):
    <head>
    <base href="http://xxxxxxx/dev6i/rwcgi60.exe/getfile/repserver/5/14532348.htm">
    </head>
    <html>
    <body bgcolor="#ffffff">
    <script>
    function validate (form)
    alert(form.DEPARTEMENT.value);
    </script>
    <form method=post action="http://xxxxxxxxx/dev6i/rwcgi60.exe?" OnSubmit="javascript:validate(this);">
    <input name="hidden_run_parameters" type=hidden value="xxxxxxxxx">
    <center>
    <p><table border=0 cellspacing=0 cellpadding=0>
    <tr>
    <td><input type=submit></td>
    <td width=15>
    <td><input type=reset></td>
    </tr>
    </table>
    <p><hr><p>
    <!-- Created by Oracle Reports 12:59 Tue Aug 13 , 2002 -->
    <table border=0 cellspacing=0 cellpadding=0 width=337>
    <tr><td width=23><td width=60><td width=15><td width=17><td width=28><td width=127><td width=32><td width=34><td width=1>
    <tr><td colspan=9 height=19>
    <tr valign=top>
    <td height=9 colspan=4>
    <td width=155 colspan=2 rowspan=2><font face="Arial"><b>Report Parameters</b></font>
    <td colspan=3>
    <tr valign=top>
    <td height=9 colspan=4>
    <td colspan=3>
    <tr><td colspan=9 height=9>
    <tr valign=top>
    <td height=9 colspan=2>
    <td width=219 colspan=5 rowspan=2><font face="Arial"><b>Enter values for the parameters</b></font>
    <td colspan=2>
    <tr valign=top>
    <td height=9 colspan=2>
    <td colspan=2>
    <tr><td colspan=9 height=9>
    <tr valign=top>
    <td height=9>
    <td width=75 colspan=2><font size=2 face="Arial"><b>Departement</b></font>
    <td colspan=2>
    <td colspan=3 rowspan=3><INPUT type=TEXT name="DEPARTEMENT" size=27 maxlength=40 >
    <td>
    <tr valign=top>
    <td height=9 colspan=5>
    <td>
    <tr valign=top>
    <td height=9 colspan=5>
    <td>
    </table>
    </center>
    </body>
    </form>
    </html>
    and the value of the parameter DEPARTEMENT is displayed in a dialog box.
    Regards

  • Javascript Question Remove Leading zero's

    I have a hidden Input form that has a value of 78, I am using
    javascript to validate that the amount the User entered in a new
    Input form is greater than the amount in the hidden form. But this
    is failing when a user enters stuff like 0775 or 000745. Is there a
    way I could remove the leading o's zeros and then do the
    validation. <cfinput validate integer> allows entering of
    leading zeros, I want to remove the leading zeros. Is it possible?
    Thanks

    quote:
    Originally posted by:
    jdeline
    Multiply by one removes the leading zeros. <CFSET foo = 1
    * userData)> Be sure to do this
    after you verify that userData is numeric.
    Regarding ensuring the value is numeric, be careful of using
    the js parseint, parsefloat or whatever those functions are called.
    They don't always return NaN (not a number) for non-numeric
    strings.

Maybe you are looking for

  • How do I get my computer to sync to my iPhone

    I have already authorized my computer but I still cannot get my computer to sync to my iPhone or transfer songs from computer to iPhone or vice versa. Everytime I go to transfer a song from my computer (I drag the song to my device) I get a big, red

  • Firefox (3.6.10) is very sluggish/slow and hangs up

    All of a sudden Firefox (3.6.10) is very sluggish/slow and hangs up I've been using Firefox (very actively) for over a year now and all of a sudden (yesterday) it began to act very sluggishly. On sites I have always visited frequently it hangs up for

  • Download and run binary files

    When downloading an exe file firefox only gives choice of saving file and not a choice to 'run' file without saving it.

  • Unable to read Class from META-INF/MANIFEST.MF file

    Hi, One of my EJB Bean is referencing a class file "test.class". So, I placed the test.class file under app-servers's "<root-dir>/lib/test.class". And added this in MANIFEST.MF file under "Class-Path" property. But the app servers is not recognising

  • IBook will not download even though it says it has already downloaded

    Hi everyone, I'm having an issue with a couple of iBooks I have recently downloaded. The iTunes store says that these books have downloaded already, however I cannot open them on my iPhone because it says that they are still downloading. Because I do