1

I have a one input type and button, which are used to enter username into the SQL database via ajax.

Now I want to achieve the validation that checks the duplicate names. If duplicate exists an error message will be shown, any help regarding this

<div id="Div1">
    <label>FormName</label>
    <input type="text" id="Text1" placeholder="Type form name here" class="form-control" />
</div>
<div id="Div2" style="float: right;">
    <input type="button" id="Button2" class="btn btn-default" style="" value="Save Form" />
    <input type="button" id="Button3" class="btn btn-success" style="" value="Add Section" />
</div>

1 Answer 1

2

This is how it will roughly look:

Back end

  • prepare SQL query that will check for duplicates
  • expose it on your server, perhaps as RESTful API or WCF

Front end

  • add an ajax call to your back end service
  • hook this call to an event, perhaps when user shift focus to another text box or maybe press a check button
Sign up to request clarification or add additional context in comments.

4 Comments

can you provide any example for this validation
@Jot It should be pretty straightforward. If you're stuck on a specific part, then ask about that specific part.
@jot something similar to this stackoverflow.com/questions/3982420/… ..
@Jot there is quite a bit of code and it depends on your approach. Try implementing it and ask a specific question otherwise it's just too much for a short and helpful answer

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.