我的表单和单选按钮有点麻烦,输入文本我这样做:
<?php echo form_input('lastname', set_value('lastname'), 'id=lastname'); ?>
<?php echo form_error('lastname'); ?>
Run Code Online (Sandbox Code Playgroud)
并且当验证运行并且填写的输入字段获得返回的值时...我正在寻找的是使用单选按钮执行此操作的方法
<tr><td><?php echo form_label('Gender: ', 'gender'); ?></td><td><?php echo form_label('Male', 'male') . form_radio('gender', 'M', '', 'id=male'); ?><br><?php echo form_label('Female', 'female') . form_radio('gender', 'F', '', 'id=female'); ?></td><td><?php echo form_error('gender'); ?></td></tr>
Run Code Online (Sandbox Code Playgroud)
正如你可以看到我的单选按钮的值已经是F或M ......如何选择返回的按钮?
我写了这段代码
echo date("Y-m-d", strtotime($date, strtotime("+ " . $days . " days")));
$date = 2012-04-12
$days = 15
Run Code Online (Sandbox Code Playgroud)
我希望将$days(15天)添加到日期(2012-04-12)我希望得到2012-04-27这个代码返回我2012-04-12,我做错了什么?
我在我的SQL查询中有这一行:
WHERE client = $id
AND (isinvoiced = 0) OR (isinvoiced = 1 and isrecurring = 1)
Run Code Online (Sandbox Code Playgroud)
这得到的结果比我预期的要多.但是,如果我这样写:
WHERE client = $id
AND (isinvoiced = 0) OR (isinvoiced = 1 and isrecurring = 1 and client = $id)
Run Code Online (Sandbox Code Playgroud)
然后它得到了我想要的结果,但这是写这个的最好方法吗?我只是不想让这个代码遇到任何问题.
在我的aspx页面中我有这个div ..
<div id="downloadableProducts" runat="server"><a href="#">Downloadedable Products</a></div>
我试图改变后面的代码中的CSS像这样..
downloadableProducts.Style("display") = "none";
但这不起作用,我downloadableProducts在后面的代码中得到一个错误和红色下划线,它说'名称'downloadableProducts'在当前上下文中不存在'
我究竟做错了什么?
我这里有这个文本框......
<input name="search" type="text" maxlength="512" id="search" class="searchField" autocomplete="off" title="" />
Run Code Online (Sandbox Code Playgroud)
我也有这个提交
<input type="submit" name="btnSearch" value="Search" onclick="location.href='http://www.website.com/search/';" id="btnSearch" class="buttonSearch" />
Run Code Online (Sandbox Code Playgroud)
我想要做的是添加我的文本框中的内容
onclick="location.href='http://www.website.com/search/';"
Run Code Online (Sandbox Code Playgroud)
所以它看起来像这样..
onclick="location.href='http://www.website.com/search/what ever the user searches';"
Run Code Online (Sandbox Code Playgroud)
我怎么会这样做,我一直在谷歌上搜索我的小心脏.
我在另一个div中有一个div,我试图调整div,所以左侧触摸左侧,右侧触及顶部.有没有与CSS有关?
这是我的代码:
.background {
background-color:black;
height:368px;
}
.sold {
background-color:red;
font-size:26px;
width:200px;
text-align:center;
height:40px;
color:white;
line-height:40px;
}
<div class="background">
<div class="sold">Sold Out</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的jfiddle:http://jsfiddle.net/vakcgvtu/
我有一个像ANC和SHO.pdf这样的网址
当我像这样编码URL时:
NSString *escapedString = [PDFPath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]];
Run Code Online (Sandbox Code Playgroud)
现在,当我使用这个URL它不起作用,我感觉它与&有关,因为当我尝试另一个文件时,它完美地工作,我能够加载PDF,但文件与&我不是.
我究竟做错了什么?
这是escapedString的输出
escapedString __NSCFString * @"Ancaster%5CANC%20&%20SHO%20-%20Laundry%20Closets%20to%20be%20Checked.pdf" 0x16ea33c0
Run Code Online (Sandbox Code Playgroud)
然后我用它来调用一个方法:
NSArray *byteArray = [dataSource.areaData GetPDFFileData:[NSString stringWithFormat:@"%@",escapedString]];
Run Code Online (Sandbox Code Playgroud)
这是方法:
-(NSArray *)GetPDFFileData:(NSString *)PDFFile
{
NSString *FileBrowserRequestString = [NSString stringWithFormat:@"%@?PDFFile=%@",kIP,PDFFile];
NSURL *JSONURL = [NSURL URLWithString:FileBrowserRequestString];
NSURLResponse* response = nil;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:JSONURL];
NSData* data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
if(data == nil)
return nil;
NSError *myError;
NSArray *tableArray = [[NSArray alloc]initWithArray:[NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&myError]];
return tableArray;
}
Run Code Online (Sandbox Code Playgroud) 所以....我有一个视图控制器,当我按下一个按钮时,会出现另一个视图控制器:
- (IBAction)searchButtonPressed:(id)sender {
[self presentViewController:self.controllerSearch animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
内部视图控制器编号2是一个表视图,当在表中选择一行时,此代码运行:
NSString *phrase = nil; // Document password (for unlocking most encrypted PDF files)
NSString *filePath2 = filePath; assert(filePath2 != nil); // Path to first PDF file
LazyPDFDocument *document = [LazyPDFDocument withDocumentFilePath:filePath2 password:phrase];
if (document != nil) // Must have a valid LazyPDFDocument object in order to proceed with things
{
LazyPDFViewController *lazyPDFViewController = [[LazyPDFViewController alloc] initWithLazyPDFDocument:document];
lazyPDFViewController.delegate = self; // Set the LazyPDFViewController delegate to self
#if (DEMO_VIEW_CONTROLLER_PUSH == TRUE) …Run Code Online (Sandbox Code Playgroud) 我有一个不需要任何参数的存储过程,并返回值0和消息:
(94 row(s) affected)
(1 row(s) affected)
Run Code Online (Sandbox Code Playgroud)
我的问题是如何获取消息:
(94 row(s) affected)
(1 row(s) affected)
Run Code Online (Sandbox Code Playgroud)
这是我调用存储过程的.NET方法:
public List<MessageClass> ChequesToUpdate()
{
message = new List<MessageClass>();
MessageClass item = new MessageClass();
try
{
using (connection = new SqlConnection(connectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand("MyStoredProcedure", connection))
{
command.CommandType = CommandType.StoredProcedure;
command.ExecuteNonQuery();
item.message = "message";
}
}
}
catch (Exception e)
{
item.message = e.Message;
}
finally
{
connection.Close();
}
message.Add(item);
return message;
}
Run Code Online (Sandbox Code Playgroud)
我希望将信息传入item.message,我将如何实现这一目标?
我有一个定义为 Error 的变量,这就是我打印它时的样子:
Optional(Error Domain=com.apple.LocalAuthentication Code=-2 "Canceled by user." UserInfo={NSLocalizedDescription=Canceled by user.})
Run Code Online (Sandbox Code Playgroud)
我想要做的是获得-2的代码......我该怎么做?
ios ×3
asp.net ×2
c# ×2
css ×2
objective-c ×2
code-behind ×1
codeigniter ×1
date ×1
html ×1
javascript ×1
onclick ×1
php ×1
radio-button ×1
sql ×1
sql-server ×1
strtotime ×1
swift ×1
where-clause ×1