我有一个包含查询变量的选择列表
<tr>
<td>County Name:</td>
<td>
<select name="countyName" onchange="countyID.value = countyName.value">
<option>Select a County</option>
<cfloop query = "getCounties">
<option value="#countyName#" >#countyName# #countyID#</option>
</cfloop>
</select>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
如何填充县ID字段?
<tr>
<td>County ID:</td>
<td><input type="Text" name="countyID">
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
我从来没用过jQuery.有没有办法只使用JavaScript?正如你可以看到我已经尝试的JavaScript,但我只能填充countyID用countyName,我需要用它填充countyID.
我用javascript有点麻烦.
这是搜索框:
<input id="lala" onkeypress="lala(event)" />
Run Code Online (Sandbox Code Playgroud)
这是脚本:
<script type="text/javascript">
function lala(e){
tecla = (document.all) ? e.keyCode : e.which;
if(tecla==13) windows.location.href = 'http://server:100/Theme/resumenInstrumento.aspx?nemo=lan';
}
</script>
Run Code Online (Sandbox Code Playgroud)
什么时候做一个javascript警报,它看起来很好,但我不能去URL.
我有一个2维数组:
var fondetcaption = [
["fond/fond1.jpg","« aaa"],
["fond/fond2.jpg","« bbb"],
["fond/fond3.jpg","« ccc"],
["fond/fond4.jpg","« ddd"]
];
Run Code Online (Sandbox Code Playgroud)
该数组可以有4,7,10,任意数量的值...
我想知道我有多少价值(在这种情况下它应该返回4)
var howmany = fondetcaption.lenght; // doesn't work !
Run Code Online (Sandbox Code Playgroud)
然后......我会显示fondetcaption[0][0](第一个背景),之后点击一个按钮,我想显示下一个:[1][0]然后是下一个[2][0]然后[3][0]再[0][0]一次....推送似乎不起作用.
任何的想法?
我被要求记录一些代码.一些javascript函数传递参数,如
onclick='showhide(<%#String.Format("\"#customer{0}\"",Container.DataItemIndex) %>);'
Run Code Online (Sandbox Code Playgroud)
你怎么能把功能放在一个功能?
do_something(){
alert('do something');
}
also_do_something = function(){
alert('also do something');
};
inp.onclick = function(){
do_something();
// this don't work
also_do_something;
};
Run Code Online (Sandbox Code Playgroud) 当我的应用程序的存储对象设置为session时,我收到此警告.
未知:会话ID太长或包含非法字符,有效字符为az,AZ,0-9和' - ,'在第0行的未知中
所以我决定Md5会话ID和警告现在消失了.但是这个代码对于memcache和phparray等所有存储选项都很常见.所以我的问题是,Md5内存缓存密钥或会话ID是否可以?它会产生一些其他问题吗?或者有更好的解决方案吗?
所以,我有两个JavaScript函数:
function Generate() {
//Do something
$.ajax({data:{Svc: 'cpMain',
Cmd: 'Generate'
},
dataType: "text",
context: this,
success: genSuccess()
});
}
function genSuccess() {
//Do something
}
Run Code Online (Sandbox Code Playgroud)
在我的c#中,Page_Init()我从我的AJAX回调中获取参数来做某事.
我想订单Generate(),回调,genSuccess().但是,在此运行的顺序是Generate(),genSuccess()回调.
我错过了什么吗?
我有一些奇怪的事情与php mail()函数.当我用PHP发送邮件时,它随机添加空格,一些浮动元素不起作用.
这些是我的标题:
$headers = 'From: ' . $website_naam . ' <' . $eigen_emailadres . '>' . PHP_EOL;
$headers .= 'Reply-To: ' . $naam_verzender . ' <' . $email_verzender . '>' . PHP_EOL;
$headers .= ($bcc_emailadres != '') ? 'Bcc: ' . $bcc_emailadres . PHP_EOL : '';
$headers .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;
$headers .= 'X-Priority: Normal' . PHP_EOL;
$headers .= 'MIME-Version: 1.0' . PHP_EOL;
$headers .= 'Content-type: text/html; charset=iso-8859-1' . PHP_EOL;
Run Code Online (Sandbox Code Playgroud)
这是我的信息:
$message = '<html><body style="font-family:Open Sans; …Run Code Online (Sandbox Code Playgroud) 我从数据库中选择了一个日期范围。对于此特定示例,日期在 6 月 20 日至 6 月 29 日之间。
我已经成功创建了这些日期的数组,但是该日期重复了很多次。
我的数组看起来像这样:
Array
(
[0] => 2013-06-20
[1] => 2013-06-20
[2] => 2013-06-20
[3] => 2013-06-20
[4] => 2013-06-20
[5] => 2013-06-20
[6] => 2013-06-20
[7] => 2013-06-20
[8] => 2013-06-20
[9] => 2013-06-21
[10] => 2013-06-21
[11] => 2013-06-21
[12] => 2013-06-21
[13] => 2013-06-21
[14] => 2013-06-21
[15] => 2013-06-21
[16] => 2013-06-21
[17] => 2013-06-21
[18] => 2013-06-22
[19] => 2013-06-22
[20] => 2013-06-22
[21] => 2013-06-22
[22] …Run Code Online (Sandbox Code Playgroud) 我正在使用PDO进行项目,但我在提交时出现语法错误...这是我的代码:
<?php
require_once('_database.php');
$titre = $_POST['titre'];
$text = $_POST['text'];
$date = date("Y-m-d");
try
{
// Insertion dans la base de donnée
$requete = $connexion->exec("INSERT INTO article (id, idAuteur, titre, text, date) VALUES (0, 0, $titre, $text, $date)");
if (!$requete) {
echo "\nPDO::errorInfo():\n";
print_r($connexion->errorInfo());
echo $requete;
}
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
?>
Run Code Online (Sandbox Code Playgroud)
这就是我在浏览器中得到的:
PDO::errorInfo(): Array ( [0] => 42000 [1] => 1064 [2] => You have an error in your SQL syntax; check the manual that corresponds …Run Code Online (Sandbox Code Playgroud)