我正在使用http://plugins.jquery.com/project/datepick上的jquery datepicker插件和datepicker验证插件.
<script id="frmValidation" type="text/javascript">
$(document).ready(function(){
var validator = $("#frmTest").validate({
rules:{
fname: "required",
dobPicker: "required"
},
messages:{
fname: "Please enter a name",
dobPicker: "Select a date"
},
});
$('#dobPicker').datepick();
$.datepick.setDefaults({showOn: 'both', dateFormat: 'dd-mm-yy', yearRange:'1900:2010'});
});
</script>
Run Code Online (Sandbox Code Playgroud)
文件正文如下:
<form id="frmTest" action="" method="post">
<div id="error-list"></div>
<div class="form-row">
<span class="label"><label for="fname">Name</label></span>
<input type="text" name="fname" />
</div>
<div class="form-row">
<span class="label"><label for="dobPicker">DOB</label></span>
<input type="text" id="dobPicker" name="dobPicker" style="margin-left: 4px;"/>
</div>
<div class="form-row">
<input type="submit" name="submit" value="submit"/>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
表单第一次验证,但是日期选择器的错误消息不会立即消失,但是如果第二次选择日期,它就会消失.任何帮助,使其第一次选择日期,将不胜感激
我正在尝试使用PHP Data API将视频上传到YouTube
$yt = new Zend_Gdata_YouTube($httpClient);
$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();
$filesource = $yt->newMediaFileSource('mytestmovie.mov');
$filesource->setContentType('video/quicktime');
$filesource->setSlug('mytestmovie.mov');
$myVideoEntry->setMediaSource($filesource);
$myVideoEntry->setVideoTitle('My Test Movie');
$myVideoEntry->setVideoDescription('My Test Movie');
// Note that category must be a valid YouTube category !
$myVideoEntry->setVideoCategory('Comedy');
// Set keywords, note that this must be a comma separated string
// and that each keyword cannot contain whitespace
$myVideoEntry->SetVideoTags('cars, funny');
// Optionally set some developer tags
$myVideoEntry->setVideoDeveloperTags(array('mydevelopertag',
'anotherdevelopertag'));
// Optionally set the video's location
$yt->registerPackage('Zend_Gdata_Geo');
$yt->registerPackage('Zend_Gdata_Geo_Extension');
$where = $yt->newGeoRssWhere();
$position = $yt->newGmlPos('37.0 -122.0'); …Run Code Online (Sandbox Code Playgroud)