Салют.
Как то мне на этом сайте написали чудесный скриптик который меня очень выручил.
Code
<script language="JavaScript">
$("#ldF10").change(function(){
var url = $(this).val();
$("#ldF11").val(url.match(/s\/(\d+)\//)[1]);
});
</script>
Суть его в том, что в каталоге файлов при добавлении материала я вставлял в input c ID ldF10 ссылку такого типа:
http://djrad.promodj.ru/tracks/2443802/Rad_van_Cor_Arabia_Original_Mix.html
Скрипт автоматом из ссылки копирует ID трека 2443802 и вставляет его в поле с ID ldF11
Но сча попробовал этот скрипт постаить на DLE
Там два поля одно с ID xfield[pdj_url] другое с xfield[id]
Вот поставил скрипт туда
Code
<script language="JavaScript">
$("#xfield[pdj_url]").change(function(){
var url = $(this).val();
$("#xfield[id]").val(url.match(/s\/(\d+)\//)[1]);
});
</script>
А он не работает(( Помогите выяснить проблему.
Вот исходник модуля
Code
<h2 class="heading">Добавить новость</h2>
<div class="brdform">
<div class="baseform">
<table class="tableform">
<tr>
<td class="label">
<span class="impot">Автор - Название трека:</span>
</td>
<td><input style="width:500px;" type="text" name="title" value="{title}" maxlength="150" class="f_input" /></td>
</tr>
<!---PDJ_URL--->
<tr id="xfield_holder_pdj_url">
<td class="label"><span class="impot">Promodj url:</span></td>
<td colspan="2"><input style="width:500px;" name="xfield[pdj_url]" id="xfield[pdj_url]" value="" class="f_input" type="text"> </td>
</tr>
<!---//PDJ_URL--->
<tr id="xfield_holder_id">
<td class="label"><span class="impot">ID аудио:</span></td>
<td colspan="2"><input name="xfield[id]" id="xfield[id]" value="" class="f_input" type="text"> </td>
</tr>
<!---Скрин--->
<tr id="xfield_holder_scrin">
<td class="label"><span class="impot">Скрин:</span></td>
<td colspan="2"><input style="width:500px;" name="xfield[scrin]" id="xfield[scrin]" value="" class="f_input" type="text"> </td>
</tr>
<!---//Скрин--->
<!---Розмер--->
<tr id="xfield_holder_size">
<td class="label"><span class="impot">Размер:</span></td>
<td colspan="2"><input style="width:35px;" name="xfield[size]" id="xfield[size]" value="" class="f_input" type="text"> МБ </td>
</tr>
<!---//Размер--->
<!---Продолжительность--->
<tr id="xfield_holder_duration">
<td class="label"><span class="impot">Продолжительность:</span></td>
<td colspan="2"><input style="width:35px;" name="xfield[duration]" id="xfield[duration]" value="" class="f_input" type="text"> мм:сс </td>
</tr>
<!---//Продолжительност--->
<!---Стиль--->
<tr id="xfield_holder_style">
<td class="addnews"><span class="impot">Стиль:</span></td>
<td class="xfields" colspan="2">
<select name="xfield[style]" class="f_input">
<option value="12" selected="selected"></option>
<option value="0">Drum & Bass</option>
<option value="1">Dubstep</option>
<option value="2">Electro-House</option>
<option value="3">Electro-Progressive</option>
<option value="4">Funky House</option>
<option value="5">Hip-Hop</option>
<option value="6">House</option>
<option value="7">Progressive House</option>
<option value="8">Progressive Trance</option>
<option value="9">Reggae</option>
<option value="10">Techno</option>
<option value="11">Trance</option>
</select></td>
</tr>
<!---//Стиль--->
[urltag]
<tr id="alt_nameTR" style="display:none"><td class="label">URL статьи:</td><td><input type="text" name="alt_name" value="{alt-name}" maxlength="150" class="f_input" /></td></tr>
[/urltag]
<tr>
<td class="label">
<span class="impot">Категория:</span>
</td>
<td>{category}</td>
</tr>
<tr id="short_storyTR" style="display:none"><td colspan="2">
<div>[not-wysywyg]<div>{bbcode}</div><textarea name="short_story" id="short_story" onclick=setFieldName(this.name) style="width:98%;" rows="10" class="f_textarea" >1</textarea>[/not-wysywyg]{shortarea}</div></td>
</tr>
<tr>
<td colspan="2">
<b>Описание:</b>
<div>
[not-wysywyg]
<div>{bbcode}</div>
<textarea name="full_story" id="full_story" onclick=setFieldName(this.name) style="width:98%;" rows="10" class="f_textarea" >{full-story}</textarea>
[/not-wysywyg]
{fullarea}
</div>
</td>
</tr>
<tr>
<td class="label">Теги:</td>
<td><input type="text" name="tags" id="tags" value="{tags}" maxlength="150" class="f_input" autocomplete="off" /></td>
</tr>
[sec_code]
<tr>
<td class="label">
Введите код<br />с картинки:<span class="impot">*</span>
</td>
<td>
<div>{sec_code}</div>
<div><input type="text" name="sec_code" id="sec_code" style="width:115px" class="f_input" /></div>
</td>
</tr>
[/sec_code]
[recaptcha]
<tr>
<td class="label">
Введите два слова, показанных на изображении:<span class="impot">*</span>
</td>
<td>
<div>{recaptcha}</div>
</td>
</tr>
[/recaptcha]
<tr>
<td colspan="2">{admintag}</td>
</tr>
</table>
<div class="fieldsubmit">
<button name="add" class="fbutton" type="submit"><span>Отправить</span></button>
<button name="nview" onclick="preview()" class="fbutton" type="submit"><span>Просмотр</span></button>
</div>
</div>
</div>
<script language="JavaScript">
$("#xfield[pdj_url]").change(function(){
var url = $(this).val();
$("#xfield[id]").val(url.match(/s\/(\d+)\//)[1]);
});
</script>