0

I want to provide the user the ability to search users within the database, and upon selection it would display various information about the user.

What I have brainstormed so far is the following.

<script type="text/javascript">
    $(document).ready(function() {

    Parse.initialize("ID", "ID");

    $('#userIDSearch').bind("submit", function (e) {

    });
</script>

<form id="userIDSearch">
    <input type="search" name="usersearch">
    <input type="submit" value="search">
</form>

Not sure what to do next and would appreciate guidance. Thanks in advance.\

Update:

<script type="text/javascript">
    $(document).ready(function() {

    Parse.initialize("ID", "ID");
    var currentUser = user;
    query.equalTo("objectId", request.params.userId);  // find user with this ID

    function searchu() {
        var user_search = $('#searchusertext').val();
        var query = new Parse.Query(User);
        query.find({
            success: function(results) {
                // results is an array of Parse.Object.
            },

            error: function(error) {
                // error is an instance of Parse.Error.
            }
        });

      $('#userIDSearch').bind("submit", function (e) {

    });
</script>

<form id="userIDSearch">
    <input type="search" id="searchusertext" name="usersearch">
    <input type="submit" id="searchuserbutton" value="search">
</form>

1 Answer 1

0

The next steps would be:

  1. Execute a function when the search button is pressed.
  2. The function should execute a Parse query with the search value passed into the query.
  3. The results will then be used to populate your UI.

Let me know if that's not enough guidance.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your kind suggestions. I would kindly require more guidance, and for your courteously, I have included the updated code under my initial post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.