|
It seams like a time-zone problem...
IE9 shows EDT (UTC-4) and IE7 shows IST (UTC+5:30)...
Can you check the time-zone settings fro your machines?
Regards
Peter
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
|
I have my code structured in such a way that clicking on an 'Edit' button displays a hidden form (written in embedded ruby) within a 'div' html tag and within that form is a text_field_tag whose id is used to tie to a datepicker using Jquery.
Using my current view code and jquery datepicker code in rails : I can click on an edit button and select a date using the text_field_tag for each form. However, when I try to submit that datepicker value it only gets submitted for the first form (for the first 'td element).
Im guessing im doing something wrong with the Jquery code.Can anyone guide me as to how I can submit the datepicker value for the corresponding form (the closest form within 'td' on button click) as opposed to only submitting for the first form(first 'td' element)
Heres my code:
VIEW in RAILS:
<h2>Files</h2>
<table class="table">
<tr>
<th>Filename</th>
<th>Description</th>
<th>Download Link</th>
</tr>
<% <a href="/Members/files">@files</a>.each do |file| %>
<% filename = file.split('/').last %>
<% object = <a href="/Members/bucket">@bucket</a>.objects[file] %>
<tr>
<td><%= filename %></td>
<td>
<div class="file_description"><%= object.metadata['description']%>
<button id ="button1" type="button" class= "btn btn-default
edit_description" onclick="Window(this)">Edit</button>
</div>
<div id = 'hidden_form' class="file_description_update" >
<%= form_tag({:action => 'update_file_info'}, multipart: true) do %>
Update File Description: <%= text_area_tag :description %>
<%= hidden_field_tag :s3_path, file %>
<%= hidden_field_tag :prefix, <a href="/Members/prefix">@prefix</a> %>
<%= text_field_tag 'user_input' %>
<%= submit_tag 'Submit' %> </td> <br />
<% end %>
</div>
</td>
Code for Jquery in application.js file in Rails:
$(document).ready(function(){
$( "button.edit_description" ).on( "click", function( event ) {
$(this).closest('td').find("div.file_description_update" ).show();
$(this).closest('td').find("div.file_description_update"
).find('#user_input').datepicker();
});
});
|
|
|
|
|
Only one DOM element can have the same id (user_input in your case).
Remove id repetitions and add to your date input fields the same class name:
...
From this moment you can easily bind datepicker to all input elements by their common class:
$('input.dateinput').datepicker();
Or you can use input fields with "numerated" names like "name="date_1","date_2" etc.
and use jQuery selector like this:
$('input[name^=date_]').datepicker();
(^= means "name begins with ...)
|
|
|
|
|
how to get first and last date from selected month from dropdown selected value using javascript
ex:selected month is in format "september 2013"
i want first date and last date of this selected month
and same selected year.
|
|
|
|
|
The first day is always going to be 1
Every month almost has 31 days
You count your knuckles, forward and backwards
Jan = 31
Fed = 28
March = 31
April = 30
May = 31
June = 30
July = 31
Aug = 31
Sept = 30
oct = 31
Nov = 30
Dec = 31
You could of just Googled it on the interwebs
32 down vote accepted
Very simple, no library required:
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
or you might prefer:
var date = new Date(), y = date.getFullYear(), m = date.getMonth();
var firstDay = new Date(y, m, 1);
var lastDay = new Date(y, m + 1, 0);
https://www.google.com/search?q=javascript%2C+get+month+strt+and+fish&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#q=javascript,+get+month+start+and+finish+dates&rls=org.mozilla:en-US:official&spell=1[^]
|
|
|
|
|
Hello everyone! Please help me out of this stuff. I am trying to design a website(Live score site) that will prompt visitors to register or login before accessing the "LiveScore.html" page. The constraints I am having now are listed below:
1. How to connect the registration page to ms sql 2005 database with a table named VisitorsInfo,
2. How to save the registree info to the database with a table named VisitorsInfo,
3. And, how to query the database for visitors info when trying to login(if the visitor info is found, then access should be granted else denied). Note: visitors will login using passcode and email. I hope my explanations are clear. And also; I hope this can be achieved with javascript. Please any help will be welcome. Thanks alot in advance! Emmanuel.
|
|
|
|
|
|
Thanks! But, what do you me by this "veni, vidi, abiit donum? Sorry if it gets you angry. But I really want to know because you have used it in many post.
|
|
|
|
|
It's his signature, which is automatically appended to every post. It's Latin for, "I came, I saw, I went home".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You're obviously a Classics scholar.
Veni, vidi, abiit domum
|
|
|
|
|
Either that or I can find my way to http://translate.google.com/[^]. The only Latin I know is "Romani ite domum".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You mean you didn't translate Homer's words from the Attic Greek?
Veni, vidi, abiit domum
|
|
|
|
|
It's a different Homer[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I use Dreamweaver to generate the rollover Javascript code to something like this:
<a href="http://url_string_here" target="_blank"
//onmouseover="MM_swapImage('Image7','','http://rolloverimage_URL/file_ro_07.jpg',1)"
// onmouseout="MM_swapImgRestore()">
The problem is the last part of the link is dynamic. so I tried to include the javascript for rollover and rollout within document.write.
document.write("<a href='http://astringforURL=" + theCourseCode + "' target='_blank'");
document.write("onmouseover='MM_swapImage('Image7','','http://rolloverimage_URL/file_ro_07.jpg',1)'");
document.write(" onmouseout='MM_swapImgRestore()'>");
IT does the link OK not the rollover anymore with this. I think it may relate to the single quotes it had initially and I had to change the double quotes into single quotes while retaining the single quote. I can't put the script to do rollover outside either.
How can I make it work?
Thanks,
|
|
|
|
|
Don't use doument.write()
During parsing parts of document (e.g. HEAD-part before body) browser finds
script inside of BODY (browser parses body part). In this case the
body object is real exist.
document.write in use of Internet Explorer may create an NEW BODY and new document.
To append objects inside actual document - actual body - please use
Javascript functions createElement() and appendElement().
var X01=document.createElement("IMG");
if(X01!=null)
{var X02=document.body.appendChild(X01);
if (X02!=null)
{
// X02 is pointer of created object inside body
}
}
|
|
|
|
|
My aspx page contains following code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" language="javascript">
function fnClickCalc() {
document.getElementById('<%= btnCalc.ClientID %>').click();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<table>
<tr>
<td> </td>
</tr>
<tr>
<td><asp:Label ID="lblFirstNo" runat="server"></asp:Label></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><asp:Label ID="lblsecondNo" runat="server"></asp:Label></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><asp:Label ID="lblResult" runat="server"></asp:Label></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><asp:Button ID="btnCalc" Text="Calculate" runat="server"
onclick="btnCalc_Click" /></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><asp:Button ID="Button1" Text="Mirror Calculate" runat="server"
OnClientClick="fnClickCalc();" /></td>
</tr>
</table>
</form>
</body>
</html>
My code behind file is,
protected void btnCalc_Click(object sender, EventArgs e)
{
lblResult.Text = lblFirstNo.Text + lblsecondNo.Text;
}
When i click "Button1" button it fires btnCalc_Click event but i am not getting "55" result since page load again fires after "btnCalc_Click" event.
However if i click "btnCalc", it shows me desired output.
Any suggestions..
|
|
|
|
|
Try:
OnClientClick="fnClickCalc();return false;"
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks..It works..It was so simple. Really appreciate your answer
|
|
|
|
|
Include jquery library from Jquery.com in header section.
Change YOur Function to this ..
<script type="text/javascript" language="javascript">
function fnClickCalc() {
var lbl1 = $("#lblFirstNo");
var lbl2 = $("#lblsecondNo");
var lbl3 = $("#lblResult");
lbl3.Text = lbl1.Text + lbl2.Text ;
}
</script>
|
|
|
|
|
do not use easyui-pagination,use jquery to made own page controls than made it can controls easyui-datagrid
|
|
|
|
|
This is not clear. What?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Either he is campaigning against jQuery EasyUI (http://www.jeasyui.com/[^]) or he is passing a peer-to-peer message to some one else through the forum.
|
|
|
|
|
hi
i want to drag a picture and it stick to positions with jquery
background picture is like a line with three circle at start middle and end.
**small picture must stop only on the backgroung picture circules.
**small picture can be draged with mouse to the positions.
thanks
|
|
|
|
|
I am not sure exactly what do you want, but assuming that you want to drag and drop page elements using jQuery. I have created a small fiddle to demonstrate how something like this can be done here.
|
|
|
|