Bienvenido, Invitado
Recordarme

TEMA:

I want to incremente a textfield when i click on a submit button 1 año 1 mes antes #258393

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2669
  • Karma: 2
  • Gracias recibidas: 145
Hello,

with me, I tested now, and everything works well.

We will try another solution, maybe helping.
Select your field 'OranginaNbre' and in Propertis->Validation click on Custom and below in te code box input this code:
function ff_OranginaNbre_validation(element, message)
{
    var num=++element.value;
    ff_getElementByName('OranginaNbre').value = num;
    return '';
} // ff_elementname_validation

Then in the Custom button which are you created in Advanced in Actionscript select Custom and Action'click', then in the code box below insert this code:
function ff_button_action(element, action)
{
    switch (action) {
        case 'click':

    ff_validate_submit();

            break;
        default:;
    } // switch
} // ff_button_action

Notes: Instead of' button' insert name (not title) your Custom button.

Hope that this solution will help :)

regard!
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

I want to incremente a textfield when i click on a submit button 1 año 1 mes antes #258401

  • Autor del tema
  • JLouis
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 30
  • Gracias recibidas: 0
Hello Mirko,
thank's for your response.
But your solution is not good for me, because i will have 16 buttons, and I don't want to white data in database on eatch click.
Your code gives me an idea. In my button, i have written:
switch (action) {
        case 'click':
    var num= ff_getElementByName('OranginaNbre').value;
    ff_getElementByName('OranginaNbre').value = ++num;

            break;
        default:;
    } // switch
And it works fine. I have just replace value=+num by value=++num :lol:

1) I will have a lot of buttons, with associated code.
I have always 2 fields: the button ex 'Orangina' and a textbox 'OranginaNbre'
is it possible to use the input parameter 'element' to name 'Orangina' and add 'Nbre' in getElementByName ? I try this code but it doesn't works
var num= ff_getElementByName(element+'Nbre').value;
2) you have the case 'click'. is there a case doubleclick (for decrementing the value) ?

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

I want to incremente a textfield when i click on a submit button 1 año 1 mes antes #258407

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2669
  • Karma: 2
  • Gracias recibidas: 145
Hello,

I didn't know for it that you will have 16 buttons, I did as you said.

1)Question
"I have always 2 fields: the button ex 'Orangina' and a textbox 'OranginaNbre'
is it possible to use the input parameter 'element' to name 'Orangina' and add 'Nbre' in getElementByName ? I try this code but it doesn't works
"
1)Answare
I am afraid that it is not possible what you want, because, in function 'ff_getElementByName' you can only call the name field!
Could you please specify what exactly you want to, and maybe I can find a solution for it?

2) you have the case 'click'. is there a case doubleclick (for decrementing the value) ?

No, but you can do the option, when you click on the field, the value of the field will be decrementing value for one or add one more button for decrementing value.

regards!
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

I want to incremente a textfield when i click on a submit button 1 año 1 mes antes #258410

  • Autor del tema
  • JLouis
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 30
  • Gracias recibidas: 0
1) What I want, is, when I click on 'Orangina' button, incremente the TextBox 'OranginaNbre' (the same name with Nbre at the end).
So, if I have 16 buttons, I will have the same code in all the buttons.
At the end, I will have 8 pages, and 16 buttons on eatch page.

2) Yes, I can create another button
The first to increment, the second to decrement, but these is already 16 buttons
it it possible to make another action in the same button with another action ? (as double click) ?

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

I want to incremente a textfield when i click on a submit button 1 año 1 mes antes #258411

  • Avatar de Mirec
  • Mirec
  • Fuera de línea
  • Ultimate Breezer
  • Ultimate Breezer
  • Mensajes: 2669
  • Karma: 2
  • Gracias recibidas: 145
Hello,

okay, I need to investigate what we can do and I will back to you as soon as possible! :)
Thank you for your patience!

regards!
Mirko

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

I want to incremente a textfield when i click on a submit button 1 año 1 mes antes #258412

  • Autor del tema
  • JLouis
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 30
  • Gracias recibidas: 0
Thank's for your help.
If it's easear for you, I can replace the buttons by TextBox, and when I click on textbox, the textbox do +1

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Moderadores: ForumSupport
Tiempo de carga de la página: 0.076 segundos