Click here to Skip to main content
15,880,503 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: date validation Pin
Pravin Patil, Mumbai24-Feb-11 1:52
Pravin Patil, Mumbai24-Feb-11 1:52 
GeneralRe: date validation Pin
Ali Al Omairi(Abu AlHassan)1-Mar-11 10:55
professionalAli Al Omairi(Abu AlHassan)1-Mar-11 10:55 
GeneralRe: date validation Pin
Manfred Rudolf Bihy1-Mar-11 21:30
professionalManfred Rudolf Bihy1-Mar-11 21:30 
GeneralRe: date validation Pin
Ali AlOmairi (TJIC)1-Mar-11 23:43
Ali AlOmairi (TJIC)1-Mar-11 23:43 
AnswerRe: date validation Pin
Pravin Patil, Mumbai24-Feb-11 1:52
Pravin Patil, Mumbai24-Feb-11 1:52 
AnswerRe: date validation Pin
Monjurul Habib1-Mar-11 7:51
professionalMonjurul Habib1-Mar-11 7:51 
Questionjquery modal return value Pin
fififlowertot20-Feb-11 23:09
fififlowertot20-Feb-11 23:09 
QuestionIt's not working..plz help me..what'was problem..somebody can to fix.. Pin
jasonp0818-Feb-11 14:12
jasonp0818-Feb-11 14:12 
It is category_parent.xml
<?xml version="1.0" ?>
<list>
<item code="77"><![CDATA[A]]></item>
<item code="10"><![CDATA[B]]></item>
<item code="28"><![CDATA[C]]></item>
<item code="7"><![CDATA[D]]></item>
<item code="1"><![CDATA[E]]></item>
<item code="66"><![CDATA[F]]></item>
<item code="11"><![CDATA[G]]></item>
<item code="29"><![CDATA[H]]></item>
<item code="70"><![CDATA[I]]></item>
<item code="9"><![CDATA[J]]></item>
<item code="63"><![CDATA[K]]></item>
<item code="55"><![CDATA[L]]></item>
<item code="6"><![CDATA[M]]></item>
<item code="8"><![CDATA[N]]></item>
</list>
----------------------------------------------------------
It is category_child.xml
<?xml version="1.0" ?>
<list>
<item parent="1" code="3"><![CDATA[E-1]]></item>
<item parent="1" code="2"><![CDATA[E-2]]></item>
<item parent="6" code="32"><![CDATA[M-1]]></item>
<item parent="6" code="33"><![CDATA[M-2]]></item>
<item parent="6" code="30"><![CDATA[M-3]]></item>
<item parent="7" code="37"><![CDATA[D-1]]></item>
<item parent="7" code="35"><![CDATA[D-2]]></item>
<item parent="8" code="41"><![CDATA[N-1]]></item>
<item parent="8" code="39"><![CDATA[N-2]]></item>
<item parent="9" code="54"><![CDATA[J-1]]></item>
<item parent="9" code="44"><![CDATA[J-2]]></item>
<item parent="10" code="47"><![CDATA[B-1]]></item>
<item parent="10" code="48"><![CDATA[B-2]]></item>
<item parent="11" code="52"><![CDATA[G-1]]></item>
<item parent="11" code="50"><![CDATA[G-2]]></item>
<item parent="29" code="62"><![CDATA[H-1]]></item>
<item parent="29" code="85"><![CDATA[H-2]]></item>
<item parent="55" code="60"><![CDATA[L-1]]></item>
<item parent="63" code="68"><![CDATA[K-1]]></item>
<item parent="63" code="75"><![CDATA[K-2]]></item>
<item parent="66" code="69"><![CDATA[F-1]]></item>
<item parent="66" code="67"><![CDATA[F-2]]></item>
<item parent="70" code="71"><![CDATA[I-1]]></item>
<item parent="77" code="82"><![CDATA[A-1]]></item>
<item parent="77" code="79"><![CDATA[A-2]]></item>
</list>
--------------------------------------------------------

List.html

<table cellpadding="0" cellspacing="0" width="176">
<tr>
<td height="24" align="left">
<select id="l_cat_parent" class="txt1" onChange="setCategory(this.value)" style="width:176px;margin-top:2px">
<option>category_parent</option>
</select>
</td>
</tr>
<tr>
<td height="24" align="left">
<select class="txt1" id="l_cat_child" style="width:176px;margin:4px 0 5px 0">
<option>category_child</option>
</select>
</td>
</tr>
</table>

<script type="text/javascript">
function setCategory(parent){
if(parent=='') parent = null;
if(parent==null){
var select_box = "l_cat_parent";
var select_name = "Product Parent";
var xml_url = "/_data/category_parent.xml"
}else{
var select_box = "l_cat_child";
var select_name = "Product child";
var xml_url = "/_data/category_child.xml"
}
DelOption(select_box);
AddOption(select_box,"","Loading...");

var xmlHttpObj = createHttpRequest();
if(!xmlHttpObj) return "Your browser is not supported";

xmlHttpObj.onreadystatechange = function(){
if(xmlHttpObj.readyState == 4) {
if(xmlHttpObj.status == 200) {
var xmlDom = getXMLDOM(xmlHttpObj);

DelOption(select_box);
AddOption(select_box,"",select_name);

var listings = xmlDom.getElementsByTagName("item");
for (var i = 0; i < listings.length; i++) {
var strCode = listings[i].getAttribute("code");
var strParent = listings[i].getAttribute("parent");
var strName = listings[i].firstChild.nodeValue;
if(strParent==parent)
AddOption(select_box,strCode,strName);
}

if($(select_box).getAttribute('selection')!=''){
SetSelectOption(select_box, $(select_box).getAttribute('selection'));
if($(select_box).onchange) $(select_box).onchange();
}else{
SetSelectOption(select_box, '');
}
}
}
}
xmlHttpObj.open("GET", xml_url); // 비동기모드
xmlHttpObj.send(null);
}
var pcategory = getCookieA("cache","pcategory"); // 기존 선택값
var ccategory = getCookieA("cache","ccategory");
$("l_cat_parent").setAttribute("selection",pcategory);
$("l_cat_child").setAttribute("selection",ccategory);
setCategory('');


var cal = new Calendar('leftCalendar');
cal.className = 'cal';
cal.onCalendarClick = function(clickdate){
var cookieDate = new Date();
cookieDate.setTime(cookieDate.getTime() + (1000 * 60 * 60 * 24 * 365 * 10)); // 10년

if($("l_cat_child").value!=''){
cat_no=$("l_cat_child").value;
setCookieA("cache","pcategory",$("l_cat_parent").value,cookieDate);
setCookieA("cache","ccategory",$("l_cat_child").value,cookieDate);
}else{
cat_no=$("l_cat_parent").value;
setCookieA("cache","pcategory",$("l_cat_parent").value,cookieDate);
setCookieA("cache","ccategory","",cookieDate);
}

location = "/product/list.asp?date="+ clickdate +"&cat_no="+ cat_no;
}
cal.Load('','');
</script>
GeneralRe: It's not working..plz help me..what'was problem..somebody can to fix.. Pin
thatraja18-Feb-11 15:09
professionalthatraja18-Feb-11 15:09 
GeneralRe: It's not working..plz help me..what'was problem..somebody can to fix.. Pin
jasonp0818-Feb-11 15:46
jasonp0818-Feb-11 15:46 
GeneralRe: It's not working..plz help me..what'was problem..somebody can to fix.. Pin
thatraja18-Feb-11 15:48
professionalthatraja18-Feb-11 15:48 
QuestionAJAX not working in IE7 on Wins Server 2003 Pin
MWRivera18-Feb-11 5:35
MWRivera18-Feb-11 5:35 
Questionjquery + iframe passing values Pin
fififlowertot16-Feb-11 22:52
fififlowertot16-Feb-11 22:52 
QuestionRe: jquery + iframe passing values Pin
Sunasara Imdadhusen16-Feb-11 23:04
professionalSunasara Imdadhusen16-Feb-11 23:04 
AnswerRe: jquery + iframe passing values Pin
fififlowertot17-Feb-11 0:33
fififlowertot17-Feb-11 0:33 
AnswerRe: jquery + iframe passing values Pin
Sunasara Imdadhusen17-Feb-11 2:11
professionalSunasara Imdadhusen17-Feb-11 2:11 
GeneralRe: jquery + iframe passing values Pin
fififlowertot17-Feb-11 2:13
fififlowertot17-Feb-11 2:13 
Questiongoogle streetview Pin
douw3rd15-Feb-11 23:58
douw3rd15-Feb-11 23:58 
AnswerRe: google streetview Pin
richardw4816-Feb-11 2:41
richardw4816-Feb-11 2:41 
QuestionYes/No Option in Javascript Pin
Toniyo Jackson15-Feb-11 2:39
Toniyo Jackson15-Feb-11 2:39 
AnswerRe: Yes/No Option in Javascript Pin
Pravin Patil, Mumbai15-Feb-11 2:51
Pravin Patil, Mumbai15-Feb-11 2:51 
AnswerRe: Yes/No Option in Javascript [modified] Pin
Sunasara Imdadhusen15-Feb-11 17:15
professionalSunasara Imdadhusen15-Feb-11 17:15 
GeneralRe: Yes/No Option in Javascript Pin
Ali Al Omairi(Abu AlHassan)25-Feb-11 8:34
professionalAli Al Omairi(Abu AlHassan)25-Feb-11 8:34 
AnswerRe: Yes/No Option in Javascript Pin
Ali Al Omairi(Abu AlHassan)25-Feb-11 8:21
professionalAli Al Omairi(Abu AlHassan)25-Feb-11 8:21 
AnswerRe: Yes/No Option in Javascript Pin
Monjurul Habib1-Mar-11 7:57
professionalMonjurul Habib1-Mar-11 7:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.