Announcement

Collapse
No announcement yet.

How get the value of a field with javascript?

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How get the value of a field with javascript?

    Hi, i have a CONTROL APP with a field type checkbox (Values Y and N), i created a button type javascript i need in this button to assign to a variable the value of the field.
    I am doing it this way:

    var v_acepta = $('sc_dan_acpto').value;

    But I getting the value: UNDEFINED

    How can i get the value?

  • #2
    if it is a control applicacion you only need to set the variable to the field and thats it

    var v_acepta = {sc_dan_acpto};

    afaik

    Comment


    • #3
      Hi, kafecadm, i tried that way but it does not work. The field name really is DAN_ACPTO, but i think SC put a suffix sc_
      Any other idea?. Thanks you.

      Comment


      • #4
        i am testing the same of examples SC, but it does not work.

        if(document.F1.dan_acpto[0].checked){
        alert("job hour above the allowed.");
        }

        Which is the way Correct?

        Comment


        • #5
          Then your code should be without the SC_ prefix.

          Comment


          • #6
            I tried this way but do not worked. In the SC help does not need prefix.

            Comment


            • #7
              Code:
              $(".sc-ui-checkbox-[[nameoffield]]")[index].checked
              and
              $(".sc-ui-checkbox-[[nameoffield]]")[index].value
              Example:

              Configuration


              Asking for values.

              Attached Files
              Last edited by Giu; 12-21-2015, 06:39 AM.
              /Giuseppe

              Professional Scriptcase Services
              Some Customers opinions

              Comment


              • #8
                Hi. Giu, thanks you, it worked fine. My line final was: $(".sc-ui-checkbox-dan_acpto")[0].checked.
                I does not undestand why the manual of SC say other things diffents about javascript and i wasted much time trying volve it.
                The manual say: document.F1.sex[0].checked But it does not Work!!.

                Thanks you Gui for help me.

                Comment

                Working...
                X