开发者

jQuery: making a div inside ajaxcall

开发者 https://www.devze.com 2023-01-23 15:28 出处:网络
Ok. If you didnt spell a full name right, and only entered the lastname, and the there exist more users with that lastname, in the recipient field, the ajax call will return an error with

Ok. If you didnt spell a full name right, and only entered the lastname, and the there exist more users with that lastname, in the recipient field, the ajax call will return an error with

开发者_运维百科

Who did you mean:

Mami Fox

Megan Fox

Blabla Fox

Now, I would like to make so you can click on them, choose who you meant to send to.

To do this I cannot use confirm, as confirm only have OK/CANCEL.

So i got told to use jQuery BlockUI Plugin, or just making a div and show().

But how can I prepend the error in a div(i know this), show it(i know this), and then make so you are able to click on them, and receive a alert on click ('you have chosen Mami Fox').

As i cannot make an prepared div with the names in(as the name are suggested from the page ajax requested, sendPM.php), and so, I would like to know how to do this.

--

Firstly i guess i would need to make json variable for each name. e.g

 name1 : 'Mami Fox', name2 : 'Megan Fox', name3: 'Blabla Fox'

So in the div you can then prepend the names in there(instead of one variable with all names including "Who did you mean"), and make them so when you click on them, it will say "You have chosen"+data.name1 (example, where data is callback function name from the ajax success)..

--Just a thought.


You're going to have to create a workflow that supports the process that you want. This means using a flowchart or something. You can't just code the solution, you have to design it. http://en.wikipedia.org/wiki/Workflow

So the user selects a last name, but more than one last name exists.

BRANCH WORKFLOW FROM "STANDARD"

Build a list of all possible choices.

Present the user with a dialog to choose the appropriate name from the given list.

User selects a name.

RESUME WORKFLOW TO "STANDARD"

0

精彩评论

暂无评论...
验证码 换一张
取 消