검색결과 리스트
form에 해당되는 글 4건
- 2013.01.28 [C#] Form close와 Dispose
- 2012.07.23 [jQuery] ajaxForm 구현
- 2012.02.21 [javascript] submitWithJson (동적으로 폼서브밋 하기)
- 2011.10.17 [jQuery] serialize()
글
링크 (Form.Dispose) : http://msdn.microsoft.com/ko-kr/library/aw58wzka(v=vs.90).aspx
링크 (Form.Close) : http://msdn.microsoft.com/ko-kr/library/system.windows.forms.form.close(v=vs.90).aspx
모달리스로 닫을시에는 Form.Close()를 호출
모달로 닫을시에는 Form.DialogResult 프로퍼티에 값을 대입
'.Net > C#' 카테고리의 다른 글
[C#] Mutex를 통한 다중 인스턴스 실행방지 (0) | 2013.02.08 |
---|---|
[C#] Visual Studio TODO 만들기 (0) | 2013.01.30 |
[C#] 정적 생성자 (static 멤버 초기화) (0) | 2013.01.15 |
[C#] Assemble.load (0) | 2013.01.15 |
[Visual Studio 2010] C# 선언할때 공백 제거 문제 (0) | 2013.01.14 |
트랙백
댓글
글
사실 ajax를 이용하는게 아니라 예전부터 많이 사용하던 iframe을 이용하여 화면 깜빡임을 없애는 방식이다.
/**
* form을 ajax로 전송한다. (파일 포함)
*/
$.fn.ajaxForm = function(handler) {
var $this = $(this);
if ( $this[0] && $this[0].tagName.toUpperCase() == "FORM" ) {
//랜덤한 수를 출력
var ranNumber = Math.floor(Math.random() * 10000) + 1;
var strId = "";
strId += "SEED";
strId += "_";
strId += (new Date()).getTime();
strId += "_" + ranNumber;
$this.attr("target", strId);
$("<iframe id=\"" + strId + "\" name=\"" + strId + "\" />")
.hide()
.appendTo($this.parents("body"))
.load(function() {
var that = this;
if ( $.type(handler) == "function" ) {
var result = $.parseJSON(window.frames[strId].document.body.innerHTML);
if ( result == undefined || result == null || result == "" ) {
result = {
success : false,
message : "결과가 존재하지 않습니다."
};
}
handler(result);
}
});
}//if ( $this[0] && $this[0].tagName.toUpperCase() == "FORM" ) {
return $this;
};
사용방법
(function($, exports) {$(document).ready(function() {
////////////////////////////////////////////////////////////////////////////////////
$("#myform").ajaxForm(function(result) {
if ( result && result.success == true ) {
alert(result.message);
}
});
////////////////////////////////////////////////////////////////////////////////////
});})(jQuery, window);
'JavaScript > jQuery' 카테고리의 다른 글
[jQuery] .attr("disabled") .attr("readonly") 리턴값 (0) | 2012.08.01 |
---|---|
[jQuery] .each $.each 순회중 continue, break 하기 (0) | 2012.07.26 |
[jQuery] Plugin Validation (0) | 2012.06.18 |
[jQuery] jQuery.type() 함수 구현해보기 (0) | 2012.02.08 |
[jQuery] jQuery API 검색 사이트 jqapi.com, visualjquery.com (0) | 2012.02.07 |
트랙백
댓글
글
/**
* obj : url or json data
* data : json data
*/
my.submitWithJson = function(obj, data, target, method) {
try {
var param = null;
// json object이라면
if ( obj && Object.prototype.toString.call(obj) === '[object Object]' ) {
param = {
'url' : obj.url || ''
,'data' : obj.data || {}
,'target' : obj.target || '_self'
,'method' : obj.method || 'POST'
};
}
else {
param = {
'url' : obj || ''
,'data' : data || {}
,'target' : target || '_self'
,'method' : method || 'POST'
};
}
//랜덤한 수를 출력
var curDate = new Date();
var ranNumber = Math.floor(Math.random() * 10000) + 1;
var strId = "";
strId += param.target;
strId += "_";
strId += curDate.getFullYear();
strId += curDate.getMonth();
strId += curDate.getDay();
strId += curDate.getHours();
strId += curDate.getMinutes();
strId += curDate.getSeconds();
strId += "_" + ranNumber;
var $newForm = jQuery("<form></form>")
.attr("name" , strId)
.attr("id" , strId)
.attr("method", param.method);
if ( $newForm ) {
if ( Object.prototype.toString.call(param.data) === "[object Array]") {
jQuery.each(param.data, function(index, val) {
var row = val;
jQuery.each(row, function(key, val) {
jQuery("<input type='"hidden"'>")
.attr("name" , key)
.attr("value", val)
.appendTo($newForm);
});
});
$newForm.appendTo(document.body);
}
else {
jQuery.each(param.data, function(key, val) {
jQuery("<input type='"hidden"'>")
.attr("name" , key)
.attr("id" , key)
.attr("value", val)
.appendTo($newForm);
});
$newForm.appendTo(document.body);
}
var myForm = $newForm[0];
myForm.action = param.url;
myForm.method = param.method;
myForm.target = param.target;
myForm.submit();
$newForm.remove();
}//if ( $popForm ) {
}
catch (e) {alert(e.message);}
finally {}
};
'JavaScript > JavaScript' 카테고리의 다른 글
[javascript] Regex 탐욕적 수량자, 게으른 수량자 (0) | 2012.07.06 |
---|---|
[Javascript] namespace 패턴 (0) | 2012.06.30 |
[javascript] 태그를 변경하기 (0) | 2012.02.09 |
[javascript] .search(), .replace(), .match() 및 정규표현식 플래그 (0) | 2012.02.09 |
[javascript] hasOwnProperty, in 객체의 프로퍼티 존재 여부 확인 (0) | 2012.02.08 |
트랙백
댓글
글
'JavaScript > jQuery' 카테고리의 다른 글
[jQuery] $.ajax json type으로 보내기 (0) | 2011.12.19 |
---|---|
[jQuery] jQuery.serializeObject() ( 폼 객체를 json 형태로 만들기 ) (0) | 2011.12.19 |
[jQuery] jQuery 항상 최신버전으로 유지 하는 방법 (0) | 2011.12.17 |
[jQuery] find, filter, children (0) | 2011.12.08 |
[jQuery] select box 추가 선택 삭제 (2) | 2011.10.27 |
RECENT COMMENT