PDA

View Full Version : what to use in the field onblur, onload, onchange...???



leonidassavvides
10-28-2008, 10:18 PM
1) Script Title: Xin's Popup Calendar

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/popcalendar2.htm

3) Describe problem: may rather fullfill with this popup a textbox, to fullfill three dropdownmenues one-next-to-other day/month/year ? how ?

document.forms.book.day.value = ????
document.forms.book.month.value = ????
document.forms.book.year.value = ????

what to use in the field onblur, onload, onchange...???


<select onblur="document.book.month.value = months[gmt2.getMonth()];" name="month" size="1" class="formfields" id="month" tabindex="23" ;>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>

leonidassavvides
10-31-2008, 06:48 PM
fullfill three dropdownmenues one-next-to-other day/month/year ? how ?
code

<td><font face="Arial, Helvetica, sans-serif" size="2">
<select name="day" size="1" class="formfields" id="day" tabindex="22" ;>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="month" size="1" class="formfields" id="month" tabindex="23" ;>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="year" size="1" class="formfields" id="year" tabindex="25" ;>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
</select>
</font></td>

leonidassavvides
10-31-2008, 07:33 PM
function getNumbers(date) {
var calRE = getFormat();
var y, m, d;

if (calRE.test(date)) {
var yIdx = calFormat.search(/yyyy/i);
var mIdx = calFormat.search(/mm/i);
var m3Idx = calFormat.search(/mon/i);
var dIdx = calFormat.search(/dd/i);

y=date.substring(yIdx,yIdx+4);
if (mIdx != -1) {
m=date.substring(mIdx,mIdx+2);
}
else {
var mm=getMonthFromName(date.substring(m3Idx,m3Idx+3))+1;
m=(mm<10)?("0"+mm):(""+mm);
}
d=date.substring(dIdx,dIdx+2);

return new Array(y,m,d);
}
else {
return new Array("", "", "");
}
}

if i have two trios of select lists[day/mo/yr] (so two links for select date dialog boxes) how i call the above function for the two ?
how i assign results to

document.forms.book.day.value = ????
document.forms.book.month.value = ????
document.forms.book.year.value = ????

document.forms.book.day2.value = ????
document.forms.book.month2.value = ????
document.forms.book.year2.value = ????

how this assignments trigered when close the "select date" dialog box ?