由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - How to create this Asp.net Textbox
相关主题
Chaago.comcontrol array in .net
我用asp.net写的网站,各位给提提意见一道mcad考试题求解(有关DataAdapter)
C# .Net programmer position in Salt Lake City area (转载)Reference type问题
ajax,json,jquery怎么自学?问题又来了.
Re: 女码工求给些意见或内推。 (转载)how to let button response 'return' key?
如何用ajax实现comments updateC# problems
大家客户端用的是Telerik KendoUI vs Sencha ExtJS?datagrid help
你们都做server side validation?数据绑定问题
相关话题的讨论汇总
话题: textbox话题: names话题: create话题: name话题: ajax
进入DotNet版参与讨论
1 (共1页)
N********n
发帖数: 8363
1
Say I use a textbox to collect several names separated by semicolons,
and then verify the input against an address book. Correct names will
have their font set to black underlined. Wrong ones will have their
font color turned to red.
Any Ajax.Net or jQuery hacks out there to simulate it? Have not done
this kinda front end stuff for a while.
a9
发帖数: 21638
2
用div+css吧。

【在 N********n 的大作中提到】
: Say I use a textbox to collect several names separated by semicolons,
: and then verify the input against an address book. Correct names will
: have their font set to black underlined. Wrong ones will have their
: font color turned to red.
: Any Ajax.Net or jQuery hacks out there to simulate it? Have not done
: this kinda front end stuff for a while.

s***o
发帖数: 2191
3
Just some brainstorming idea, I am not sure if there are already built-in or
short-cut ways of doing this:
Since a single textbox is used for all the names, it seems customizing the
validation engine is not a good way.
you could send the names to the server through jQuery ajax call, then parse
it and compare it with the address book, then return a List of the names
with extra information such as "IsCorrect" to the client.
Based on the "IsCorrect", you can apply different css styles to the names,
and concatenate them together, and then finally load it back into the
textbox.
Something like:
$.ajax({
type: "POST",
url: "[yourWebServiceMethodURL]",
data: "[theOriginalNameList]",
...
success: function (response){
// response contains the returned name list
var resultString = "";
for (var i = 0; i < response.length; i++){
var name = response[i].Name;
var status = response[i].IsCorrect;
var formattedName = [add styles to name based on status];
resultString += formattedName;
}
$("#yourTextBoxId").html(resultString); // or .val(...)?, couldn't remember
which one
}
...
});
btw, JSON.Stringify() is my favorite way to construct the data to be sent to
the server.
Or, if the address book is small, you can "get" it onto the client through
ajax call, and apply the comparison logic on client side.
a9
发帖数: 21638
4
I dont think a single input can do this.

or
parse

【在 s***o 的大作中提到】
: Just some brainstorming idea, I am not sure if there are already built-in or
: short-cut ways of doing this:
: Since a single textbox is used for all the names, it seems customizing the
: validation engine is not a good way.
: you could send the names to the server through jQuery ajax call, then parse
: it and compare it with the address book, then return a List of the names
: with extra information such as "IsCorrect" to the client.
: Based on the "IsCorrect", you can apply different css styles to the names,
: and concatenate them together, and then finally load it back into the
: textbox.

s***o
发帖数: 2191
5
it's fine with textarea

【在 a9 的大作中提到】
: I dont think a single input can do this.
:
: or
: parse

D******y
发帖数: 3780
6
SharePoint People Picker works like this. check out its HTML source?

【在 N********n 的大作中提到】
: Say I use a textbox to collect several names separated by semicolons,
: and then verify the input against an address book. Correct names will
: have their font set to black underlined. Wrong ones will have their
: font color turned to red.
: Any Ajax.Net or jQuery hacks out there to simulate it? Have not done
: this kinda front end stuff for a while.

n**********b
发帖数: 253
7
put all correct name in a span element and then add a class to the span
before return from Ajax call.
set the spam's css class in the client side.
1 (共1页)
进入DotNet版参与讨论
相关主题
数据绑定问题Re: 女码工求给些意见或内推。 (转载)
自动化的问题 (WebBrowser)如何用ajax实现comments update
A VB Question from a beginner大家客户端用的是Telerik KendoUI vs Sencha ExtJS?
A Bug about TextBox?你们都做server side validation?
Chaago.comcontrol array in .net
我用asp.net写的网站,各位给提提意见一道mcad考试题求解(有关DataAdapter)
C# .Net programmer position in Salt Lake City area (转载)Reference type问题
ajax,json,jquery怎么自学?问题又来了.
相关话题的讨论汇总
话题: textbox话题: names话题: create话题: name话题: ajax