How to restrict user entered numbers/extracts only numbers

qst1- I use a text input (flash component) to which the user will enter numbers only in (the integers and floating-point numbers) but not any other symbol.

Copy the following code


on keyDown me

If ("1234567890 -") contains the key or the key = backSpace or key = tab keyCode = 123 or the keyCode 124 = then
Pass
on the other
stopEvent
end if

end

works fine when I use it with old text style of the fields to the Director. However, it does not work with the new flash component style (text).

QST 2- and, possibly, very simple problem:

I have an another text field that the user must enter numbers (integers or floating-point number), separated by a comma. Then after the button presses to calculate a mathematical operation on them.

What I need is access to the numbers only (and not commas) in a list then do some math advanced on these figures.

How can I write a piece of code for this?

My own code


Repeat with i = 0 to nPoints-1
xList.append (float (xTmp.char [2 * i + 1]))
end repeat

(where he resumed (2 * i + 1) odd number entered (e.g. 1. 3 5. ..., because I know that users start with the first number in position 1 then separate with comma second number gets 3. position,...)

As said it does the job only if the whole written user and the code does not work when the user enters decimal numbers.

Any suggestion/help is appreciated?

Best regards!

HUMAN RESOURCES

QST 2

I have an another text field that the user must enter numbers (integers or floating-point number), separated by a comma. Then after the button presses to calculate a mathematical operation on them.

What I need is access to the numbers only (and not commas) in a list then do some math advanced on these figures.

How can I write a piece of code for this?

Have you considered text segmentation in defining 'itemDelimiter' and then grabbing point-by-point? For example:

aString = "1,2,3,4,5,67,3.1415"
the itemDelimiter = ","
put aString.item.count
-- 7
put aString.item[7]
-- "3.1415"

Tags: Director

Similar Questions

  • How to restrict users to install software on XP pro

    I want to know how to prevent users from installing software on our PC. I watched security policies, but it was not completely clear how to proceed. Where can I find the good ploicy of change?

    can install only Administrator/s.

    configure accounts log no administrator for them

    password protect the admin log - on.

  • How to restrict user access to must enter a value in the mandatory fields

    Greetings!

    I had a personal information form. I want to restrict the user to enter values in all areas of mandatory for example fields (username, date of birth, etc.)
    How to limit the search user must enter a value in the mandatory fields

    Create dynamic actions for each of the fields, or you can create javascript.
    for example create dynamic action 1 with event as tune-up losing select the item and the condition as NULL and action as alert and type the message you want to display in the text section.

    Thank you
    Mehabub

  • How to restrict search results to photos only?

    How can I limit a search of my hard drive to the photos only? I need to make a backup of a portable D H and don't want a lot of other stuff too. I need to clean this computer and have 10 years of photos somewhere. Please help quickly-thanks!

    *.Gif and *.jpg research

  • How to restrict user access to edit page content or page

    Hi all

    I want to restrict the user to access certain pages in my application or even if the user cannot access the page, you must disable to insert, change, or delete any item in the form on the page.

    Thanks and greetings

    Pankaj Kumar says:

    I want to restrict the user to access certain pages in my application or even if the user cannot access the page, you must disable to insert, change, or delete any item in the form on the page.

    You need to read the security of the APEXdocumentation, specifically using authorisation schemes to restrict access to pages and the rendering of the control of the components.

  • How to restrict user access mutiple clicks with asynchrounous behavior of FLEX

    I developed a flex application and it has a datagrid control, and double click on the DataGrid, I show a pop-up window (the code in the pop-up window to call httpService.send () to get the data and display). Before the popup is open, the user is double clicking again on the data grid, which inturn is trying to open the pop-up window (with a new call to the web service). These calls are piling up. How can I limit using httpService.send () when the user double clicked for the second time on the datagrid control. Since then, call web service async by nature, I'm not able to find a way to do this. Can someone please help.

    set

    This.Enabled = false;

    After the service.

    and in the event of failure/result.

    This.enabled = true;

    Yet, all things BUSYCURSOR, because referring the good user.

  • How to limit users to create GOLD from requisition autocreate/find in Oracle

    How to restrict the users and buyers to create PO from find/autocreate order form in Oracle? IE I want to stop users to manually enter purchase orders.

    It will be as simple as creating a responsibility with a menu such as the function Create PO is removed?

    Hello

    Please find below Metalink which allows you to configure your condition effectively.

    How to restrict users to only create purchase orders that are associated with applications? (Doc ID 1304521.1)

    to hit the correct answer if you find the answer useful.

    Kind regards

    Hidayatulla

  • mx459 won't let me enter the WEP key number, allows only symbols and letters. How to enter numbers?

    mx459 won't let me enter the WEP key number, allows only symbols or letters. How to enter numbers?

    John

    This might help

    Press the SETUP button on the control panel of your printer.
    Using the arrows, select DEVICE SETTINGS, press OK.
    Select local network SETTINGS, then press OK.
    Select Configuration LAN wireless, and then press OK.
    If a message appears, press the WPS button, press STOP to cancel.
    Select STANDARD INSTALLATION in the next screen that appears, and then press OK.
    Select your access point or router, and then press OK.
    Press OK to confirm the access point name.
    Enter your password using the numeric keypad on the right.
    On the screen where you enter your password at the top right of the LCD screen, you should see a: 1. This indicates you are in digital input mode. If you press the asterisk (*) will be fixed: has or uppercase mode, pressing asterisk with tiny switch. To enter a letter in letter mode, you press the digital key to scroll through the available letters. For example: to enter a letter 'c', you press the '2' three times.
    Press OK when finished.
    The LCD will say "Connected", if the password is correct.

  • How to restrict the user to enter not same value in a table

    Greetings!

    I m asking a second time the upfront because I did not answer preivously, so please don't mind if it's a double.

    It was: I have created a table, as shown in the example.

    I want to validate the user name that you see in my example to restrict the user to enter the same value in the user name field before submitting page.

    for example when the user enters data as u see test in user name in the first row, when it goes to the second row and type same username as test "message will appear or restrict the user who has already typed or in use"...

    http://Apex.Oracle.com/pls/Apex/f?p=45296:1:22797340776918:

    It's all done on typing submit prior to registration.

    Please drivers

    Hello

    I m asking a second time the upfront because I did not answer preivously, so please don't mind if it's a double.

    It was: I have created a table, as shown in the example.

    I want to validate the user name that you see in my example to restrict the user to enter the same value in the user name field before submitting page.

    for example when the user enters data as u see test in user name in the first row, when it goes to the second row and type same username as test "message will appear or restrict the user who has already typed or in use"...

    http://Apex.Oracle.com/pls/Apex/f?p=45296:1:22797340776918:

    It's all done on typing submit prior to registration. >

    Stick the code below into the Page header > Javascript > run when loading the Page field.

    $('[input[name="f03"]').blur(function(){
      if ($('input[name="f03"][id!="'+$(this).attr('id')+'"]').val() == $(this).val()) {
         alert('Duplicate Entry.');
         var x = $(this).attr('id');
         setTimeout("(function(p){$('#'+p).focus();})('"+x+"')",100);
      }
    })
    

    Note:
    a.F03 is the 'name' of your column of username in the form of tables.
    b. This only valid values. If your tabular presentation has multiple pages then all of the rows are not currently displayed will be ignored.

    See you soon,.

  • How to restrict the user to enter data into the PLUGS DO

    Hello

    I textinput in my page, I have to restrict the user to enter the data covers only.

    can someone help me on this.

    Knockaert

    Please go through this site.

    http://oracleanil.blogspot.com/2010/10/restrict-user-to-enter-data-in-caps.html

    Concerning
    Meher Irk

  • How to make a user able to connect only once? and how do I restrict a user authorized to vote only 15 candidates and the brand of vote count?

    Hello

    I'm just doing my project which is the voting system. So my first question is how to make a user or a voter can connect once only using their username and password? After that they brought their vote, they can not be able to connect to a vote. Here, the user name, I replace it with IC and the password I can replace the ID (student ID). Here is my code for the connection:

    <?php
    if(isset($_POST["submit"])){
    $user=$_POST['IC'];
    $pass=$_POST['ID'];
    
    
    $con=mysql_connect('localhost','root','pass') or die(mysql_error());
    mysql_select_db('ses') or die("Cannot select DataBase");
    
    
    $query=mysql_query("SELECT * FROM voters WHERE IC='".$user."' AND ID='".$pass."'" );
    $numrows=mysql_num_rows($query);
    if($numrows!=0)
    {
    while($row=mysql_fetch_assoc($query))
    {
    $dbusername=$row['IC'];
    $dbpassword=$row['ID'];
    
    
    }
    
    
    if($user == $dbusername && $pass == $dbpassword )
    {
    session_start();
    $_SESSION['sess_user']=$user;
    $_SESSION['sess_pass']=$pass;
    
    
    
    
    /*Redirect browser*/
    header("Location: main.php");
    }
    }else{
    echo "Invalid IC Number and ID Number!";
    }
    }
    ?>
    
    

    for the second question is how to limit a voter to vote only 15 candidates and counting of the vote that voters go? When the vote is made with 15, then the popup script appears informed that the elector make themselves with their vote.for this I use box as a method of voting and each checkbox have the id which is the primary key. I appoint the id as 'No' and set it as the primary key. Here is the code for voting:

    <?php
    $servername = "localhost";
    $username = "root";
    $password = "pass";
    $dbname = "ses";
    
    
    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);
    // Check connection
    if ($conn->connect_error) {
         die("Connection failed: " . $conn->connect_error);
    }
        
    $sql = "SELECT No, Calon, ID, Jurusan, Image FROM candidates";
    $result = $conn->query($sql);
    
    if(isset($_POST['vote'])) {
        
    //get the ID value from the radio button form field and store in an array.
    $update_vote = $_POST['candidate_id'];
    
    //loop through the array and update the database
    foreach ($update_vote as $value) {
    $vote_sachin = "UPDATE candidates SET Undi=Undi+1 WHERE No=".$value."";
    $run_sachin = mysqli_query($conn, $vote_sachin);
    
    
        }
    
      header("Location:http://localhost/VotingSystem/");
    }
    
    
    ?>
    
    
    <form method="post" id="form1" action="main.php">
    <?php
    if ($result->num_rows > 0) {
    echo "<table border >
    
    
    <tr>
    <th>NO</th>
    <th>Candidate</th>
    <th>INFO</th>
    <th>Vote</th>
    </tr>";
    // output data of each row
    while($row = $result->fetch_assoc()) {
    echo "<tr>
    <td align='center'>" . $row["No"]. "</td>
    <td><img src=" . $row['Image'] . " width=120px height=150px></td>
    <td><br/>" . $row["Calon"]. " <br/>" . $row["ID"]. " <br/>" . $row["Jurusan"]. "<br/></td>
    <td align='center'><input type='checkbox' name='candidate_id[]' value='".$row['No']."'></td>
    </tr>";
    }
        echo "<tr><td></td><td></td><td></td>
        <td><input type='submit' name='vote' value='VOTE'</td>
        </tr>";
    echo "</table>";
    
    
    } else {
    echo "0 results";
    }
    $conn->close();
    
    
    ?>
    
    

    I hope someone can help me with this because I'm still trying to learn this by my own php code...

    Thank you

    # 1, add a Boolean column in the table (VoteSubmitted) and the value initially FALSE to follow if the user has already voted.  Check this field when they connect. If the field is set to TRUE, displays a message and cannot vote again. When they get it vote, update the field from FALSE to TRUE.

    # 2, I would like to do this with javascript to allow them to select all their candidates and submit once. You could start with something like this:

    Cut paste & limit the number of boxes checked script

  • How to make a text field so that if a user enters a lower case A, we make a capital?

    Hello

    We have a text field in one of our screens in the blackberry application.

    We have created the custom text filter so that the user can enter only the letters 'A' and the numbers in the text field. Now we need if the user enters 'a', we need to change it to 'A'.

    How can we achieve this?

    Thank you.

    Hi all

    I tried the following code and it worked.

    public char convert(char character, int status) {
        // TODO Auto-generated method stub
        if (!validate(character)) {
            return 0;
        }
        if (character == 'a') {
            return 'A';
        } else
            return character;
    }
    
  • Restrict a TextInput to accept only numbers from 0 to 250

    I want to restrict a TextInput to accept only numbers from 0 to 250. I know that I can use limit to a certain extent, but all I can do is limit to 0-9 and use maxChars to 3 that allows any number from 000 to 999.

    I think I could use the TextEvent.TEXT_INPUT and then write the code that will convert the text of the event (i.e., the text entered in the textInput component, before it is actually added to the text of the textInput component value) such that I allow not values greater than 250, but I'm not sure of what would be the code. Does anyone know an easier way to do this?

    Use the change event to monitor the input value and if it is greater than 250 (after tapping the property text as a number), assign the property of text to be "250".

  • Screenshot restricted to some numbers user input?

    I wrote a function that restricts user numbers (0-9) to input and saves the entry in the associative array, [userInput]. It works but it seems inefficient looping through the chain of input text to rub invalid characters. Anyone have any suggestions for a more effective approach? Note that a working solution should deal properly with the mouse or cursor movement keys/changes in the input area.

    In addition, you can see that I use the KeyboardEvent.KEY_UP event to trigger processing. The docs seem to indicate that TextEvent.TEXT_INPUT is really the event suitable for this purpose. I started with TextEvent.TEXT_INPUT but find the event fires before the last key is actually added to the instance. The result is that the function has always been a character behind. Is there an easy way to get the current text in the input area, including the last key pressed, when TextEvent.TEXT_INPUT processing?

    Maybe I don't understand the problem. But wouldn't be more simple just prevent the user to type only numbers?

    Search for TextField.restrict in the help files. It seems that something might want you?

  • I was entering numbers in a table of existing pages and suddenly the formatting has changed and I can't type numbers the way I need too.  How to fix this?

    I was entering numbers in a chart in Pages to update the information and all of a sudden the cells do not have the formatting that I want.  It's changing the way numbers which I type them, and I don't know why or what to do?

    Hi Slf@LF,

    Numbers and pages are trying to be smart and recognize wht kind of data that you enter. If you enter something that resembles a date they will treat it as such. Some people have problems with serial numbers because programs to format their numbers and not text.

    View the data that you are trying to enter and how it's changed and we ca probably to understand what is happening to her.

    Quinn

Maybe you are looking for

  • How many tabs can be defined on a page

    How many tabs can be defined on a page

  • Satellite P200 - 14 H no sound using external speakers

    Hi all I removed the speakers of the socket CAP and when I reinserted the card I did not all sounds.When the external speakers were connected on the laptop, I would get a low noise through the speakers of the laptop. Now its seems to be the opposite

  • DAQmx: synchronization of the two tasks of pulse output

    Hey Gang, I need to synchronize two tasks of pulse output.  I use the PCI-6601 Counter-Timer.  I need to use two tasks because the second output frequency must be a multiple of the first.  I think that the way to do it is using arm Start Trigger func

  • Explorer Windows has stopped working - every 30 seconds.

    Hi guys,. I hope you can help, I thought I would ask here first, but I have a feeling that I may just have to wipe the laptop. I have an Acer laptop with Vista Home Premium SP2 - 32 bit Sys. Suddenly, I restarted my laptop and every 30 seconds (ish)

  • HP Office Jet 5610 all in one does not appear with the fax

    I got a new computer with Windows 7 when I added my printer HP Office Jet 5610 all in one, it does not appear with the fax.  When I tried to install it with the disc from the printer, he Wouln't install.  What is the problem? I really need on the par