|
<?xml version="1.0" encoding="gbk" ?>
- <ajax>
- <![CDATA[
<div style="width: 0px;">
<div class="popTop">创建相册</div>
<table class="vt mb5 z" width="100%">
<tr class="tr3">
<td width="70">相册名*</td>
<td><input type="text" class="input input_wa mr5" id="c_ajax_aname" name="aname" /><span id="c_ajax_aname_warn">限 24 字节</span></td>
</tr>
<tr class="tr3">
<td>描述</td>
<td>
<textarea id="c_ajax_aintro" name="aintro" class="textareaA mb5"></textarea>
<p id="c_ajax_aintro_warn" class="gray"> 限 255 字节</p>
</td>
</tr>
<tr class="tr3">
<td>可见度</td>
<td>
<select name="private" id="private_info" onchange="optionsel(t s.value)" class="select_wa">
<option value="0">全站用户可见</option>
<option value="1">仅好友可见</option>
<option value="2">仅自己可见</option>
<option value="3">需要密码访问</option>
< lect>
</td>
</tr>
<tbody id="photopwd" style="display:none">
<tr class="tr3">
<td>输入密码</td>
<td>
<input type="password" name="pwd" class="input input_wa mr5" id="c_ajax_pwdinfo" /><span id="c_ajax_pwdinfo_warn">最小长度:3 最大长度:15</span>
</td>
</tr>
<tr class="tr3">
<td>确认密码</td>
<td>
<input type="password" name="repwd" class="input input_wa" id="repwd_info" />
</td>
</tr>
</tbody>
</table>
<div class="popBottom"><span class="btn2"><span><button type="submit" onclick="fetchvalue();">提 交< tton></span></span><span class="bt2"><span><button type="button" onclick="closep();">取消< tton></span></span></div>
</div>
<script language="JavaScript">
var charset = 'gbk';
setTimeout(function(){initCheckTextNum('c_ajax_aname','c_ajax_aname_warn',24);},300);
setTimeout(function(){initCheckTextNum('c_ajax_aintro','c_ajax_aintro_warn',255);},300);
setTimeout(function(){initCheckTextNum('c_ajax_pwdinfo','c_ajax_pwdinfo_warn',15);},300);
function optionsel(id) {
pwdobj = getObj('photopwd');
if (isNaN(id)) {
showDialog('error','非法操作');
}
if (id == '3') {
pwdobj.style.display = '';
} else {
pwdobj.style.display = 'none';
}
}
function fetchvalue() {
var aname = getObj('c_ajax_aname').value;
var aintro = getObj('c_ajax_aintro').value;
var privated = getObj('private_info').value;
var pwd = getObj('c_ajax_pwdinfo').value;
var repwd = getObj('repwd_info').value;
var albumnum = "";
var maxlength
if(albumnum == "" || albumnum == 0 || albumnum == "0"){
albumnum = "";
}else{
var maxlength = albumnum;
albumnum = '您还可以上传'+albumnum+'张照片';
}
if (IsElement('gdcode')){
var gdcode = getObj('gdcode').value;
}
if (IsElement('qanswer')){
var qanswer = getObj('qanswer').value;
}
if (IsElement('qkey')){
var qkey = getObj('qkey').value;
}
if(IsElement('gdcode') && gdcode == ""){
showDialog('error','请输入验证码',2);
return false;
}
if (IsElement('qanswer') && qanswer == ""){
showDialog('error','请输入问题答案',2);
return false;
}
ajax.send("apps.php?q=photos&a=create",'step=2&checkpwd=1&aname=' + aname + '&aintro=' + aintro + '&pwd=' + pwd + '&repwd=' + repwd + '&private=' + privated + '&gdcode=' + gdcode + '&qanswer=' + qanswer + '&qkey=' + qkey,function(){
var rText = ajax.request.responseText.split('\t');
if (rText[0] == 'success') {
var aidsel = getObj('aidsel_info');
var option = elementBind('option');
option.innerHTML = aname;
option.value = rText[1];
option.selected = 'selected';
//photoselect.vir.getElementsByTagName('h4')[0].innerHTML=aname;
aidsel.insertBefore(option,null);
aidsel.selectedIndex = aidsel.options.length-1;
getObj('aidsel_info').parentNode.getElementsByTagName('button')[0].innerHTML= aname;
var job = 'flash';
if (job == 'flash') {
uploader.setAlbumId(aidsel.value);
showDialog('success','相册添加成功!',2,function(){
});
}
getObj('allowflash').innerHTML = albumnum;
showDialog('success','相册添加成功!',2,function(){
});
uploader.maxLength = maxlength;
uploader.countFile();
} else if (rText[0] == 'limit_num') {
showDialog('error','您创建的相册已经达到'+rText[1]+'个',2);
} else {
showDialog('error',rText[1] != '' ? rText[1] : '非法错误',2);
}
read.menu.style.top="300px";
closep();
});
}
</script>
]]>
</ajax> |
|