我使用jquery滑块来选择开始和结束时间这很好,但我需要添加限制.基本上,我有一个可用的窗口,我需要消除.所以在我的例子中:http: //madeeasyfor.me/stackoverflow/time_pick_test_1.html
(我已经评论了验证功能,因此您可以看到滑块,代码具有所有脚本的绝对路径,因此可以随意获取本地使用的视图源转储)
我有一个24时钟.使用动态生成的PHP脚本,我想添加各种预订时间..所以当用户尝试选择预订时间时,他们会收到错误(弹出,无论如何).现在,我很难编码我预订的时间.
我不能为我的生活似乎让滑块识别所选择的预订时间.
如果我不清楚任何事情,请问......一旦用户选择了一个时间,我就可以用PHP进行检查,但我希望用户立即知道.(理想情况下,我想给幻灯片上色以标记预定的时间......但那是另一个问题... ;-p
三...
有人知道原因:
class Booking extends Controller {
function booking()
{
parent::Controller();
}
function send_instant_to_paypal()
{
print_r($_POST);
echo '<hr />';
print_r($this->input->post());
echo '<hr />';
$id_booking = $this->input->post('id_booking');
$title = $this->input->post('basket_description');
$cost = ($this->input->post('fee_per_min') * $this->input->post('amount'));
echo $id_booking;
echo $title
echo $cost
}
}
Run Code Online (Sandbox Code Playgroud)
将回显CI中的变量用于$ _POST但不用于$ this-> input-> post();?
我已经使用了$ this-> input-> post()并在网站的其他地方搜索了一个搜索页...但是在这个页面上,它不起作用..这是我的表格......
<form id="add_funds" action="' . site_url('booking/send_instant_to_paypal') . '" method="post">
<input type="text" name="amount" id="amount" value="" />
<input type="hidden" name="id_booking" id="id_booking" value="0" />
<input type="hidden" name="basket_description" id="basket_description" value="Adding Credit" />
<input type="hidden" name="fee_per_min" … 我正在使用Ruby来读取XML文档并使用新值更新单个节点(如果存在).
http://www.nokogiri.org/tutorials/modifying_an_html_xml_document.html 对我来说并不是很明显如何更改节点数据,更不用说如何将其保存回文件.
def ammend_parent_xml(folder, target_file, new_file)
# open parent XML file that contains file reference
get_xml_files = Dir.glob("#{@target_folder}/#{folder}/*.xml").sort.select {|f| !File.directory? f}
get_xml_files.each { |xml|
f = File.open(xml)
# Use Nokgiri to read the file into an XML object
doc = Nokogiri::XML(f)
filename = doc.xpath('//Route//To//Node//FileName')
filename.each_with_index {
|fl, i|
if target_file == fl.text
# we found the file, now rename it to new_file
# ???????
end
}
}
end
Run Code Online (Sandbox Code Playgroud)
这是一些示例XML:
<?xml version="1.0" encoding="utf-8">
<my_id>123</my_id>
<Route>
<To>
<Node>
<Filename>file1.txt</Filename>
<Filename>file2.mp3</Filename>
<Filename>file3.doc</Filename> …Run Code Online (Sandbox Code Playgroud) 我正在扫描文件夹中的音频文件,并将它们转换为mp3。在RUBY中效果很好。但是,完成第一个转码后,它将停止整个循环
这是我的代码处理的分解。
def scanFolder
# lots of code above to get folder list, check for incorrect files etc..
audioFileList.each {
|getFile|
exec_command = "ffmpeg #{getFile} #{newFileName}"
exec exec_command
}
end
Run Code Online (Sandbox Code Playgroud)
发生的事情是,它将对找到的第一个文件进行代码转换,然后停止整个功能。有办法强迫它继续吗?
ffmpeg目前确实可以正常运行并完成,因此它没有破坏任何内容
http://jsfiddle.net/7uygxcdL/7/
我试图在选择更改时获得父div的孙子的val.我将包括一个小提琴,但可以根据需要在此处放置代码......
所以在示例中..如果更改第一个选择,我想控制日志键1和val 1
如果你改变秒数,我想要键2和val 2 ......
我现在要阅读jquery查找的DOM.
$('.reward_select').change(function(){
console.log($(this).next('input[name="reward_key"]').val());
console.log($(this).next('input[name="reward_value"]').val());
});
Run Code Online (Sandbox Code Playgroud)
我的HTML:
<div class="reward_entry">
<div class="reward_item">
<div class="col-sm-2">
<select name="item_type[]" class="reward_select">
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</select>
</div>
<div class="col-sm-2">
<input type="text" name="reward_key[]" value="key 1" />
</div>
<div class="col-sm-2-offset-5">
<input type="text" name="reward_value[]" value="val 1" />
</div>
</div>
====================
<div class="reward_item">
<div class="col-sm-2">
<select name="item_type[]" class="reward_select">
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</select>
</div>
<div class="col-sm-2">
<input type="text" name="reward_key[]" value="key 2" />
</div> …Run Code Online (Sandbox Code Playgroud)