0

I have text field called "Proveedor" like this:

<tr>
        <td nowrap="true" valign="top" width="113px" class="ms-formlabel"><span class="ms-h3 ms-standardheader" id="Proveedor">
        <nobr>Proveedor</nobr>
    </span></td>
        <td valign="top" width="350px" class="ms-formbody">
        <!-- FieldName="Proveedor"
             FieldInternalName="Proveedor"
             FieldType="SPFieldText"
          -->
            <span dir="none"><input type="text" value="" maxlength="255" id="Proveedor_9ae60a83-59a5-4415-84d8-51ba698b8538_$TextField" title="Proveedor" style="ime-mode : " class="ms-long ms-spellcheck-true"><br></span>



        </td>
    </tr>

That I want to do is to get value of that field, so I try:

var emailSpan = $("input[id='Proveedor']").val()

But I got undefined, someone knows what am I doing wrong? Regards

0

ID that you have used i.e Proveedor is the ID of td and not the input tag. That's why you are getting undefined. ID of your input tag is different.

Try below code:

var emailSpan = $("input[title='Proveedor']").val()

OR

var emailSpan = $("input[id='Proveedor_9ae60a83-59a5-4415-84d8-51ba698b8538_$TextField']").val()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.