SP List Auto complete validation to ensure user select populated item

Shri-6058 326 Reputation points
2020-11-28T17:57:35.157+00:00

Hello, I have a an issue validating user making sure he/she select the auto populated from the dropdown. I am populating post activities assigning values to other fields. If user not selected and just type values, its not happening. Is it possible to return to the same textbox if user not selected(and just typed). Something .Keyup or textbox change focus? Please advise.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,624 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,573 questions
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,016 Reputation points
    2020-12-02T03:36:41.607+00:00

    Hi @Shri-6058 ,

    You could create the form like this:

    @using (Html.BeginForm("Form2", "Home", FormMethod.Post))  
    {  
        <table>  
            <tr>  
                <td>Enter ID: </td>  
                <td>@Html.TextBoxFor(m => m.Id)</td>  
            </tr>  
            <tr>  
                <td>Enter Name: </td>  
                <td>@Html.TextBoxFor(m => m.EmpName)</td>  
            </tr>  
            <tr>  
                <td colspan="2"><input type="submit" value="Submit Form" /></td>  
            </tr>  
        </table>  
    }  
    

    Then add the js for validation when submit the form:

    44245-image.png

    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Shri-6058 326 Reputation points
    2020-12-03T20:50:26.983+00:00

    Thank you. Appreciate it.

    0 comments No comments