|
Hi,
Datetime can't be change to other format [dd/MM/yyyy] to [MM/dd/yyyy],[yyyy/MM/dd],... like that
<pre lang="text">
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JqueryDate.aspx.cs" Inherits="DtPicker.JqueryDate" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
<title></title>
<script src="Scripts/jquery-1.7.1.min.js"></script>
<script src="Scripts/jquery.jdpicker.js"></script>
<link href="Scripts/jdpicker.css" rel="stylesheet" />
</head>
<script type="text/javascript">
// $(document).ready(function () {
// });
$("#Country").change(function () {
var ddl_value = $('#Country').val();
//$("#test1").val(ddl_value);
$("#dt").val(ddl_value);
location.reload(); // datepicker select to reload
})
$('#dt').jdPicker({
date_format: $("#dt").val()
//date_format:"MM dd YYYY"
})
</script>
<body>
<form id="form1" runat="server">
<select id="Country">
<option value="dd/mm/YYYY">Ind dd/mm/YYYY</option>
<option value="FF dd YYYY">Russia FF dd YYYY</option>
<option value="dd MM YYYY">Qatar dd MM YYYY</option>
<option value="MM dd YYYY">Japan MM dd YYYY</option>
<option value="dd FF YYYY">Singapore dd FF YYYY</option>
<option value="YYYY/mm/dd">Canada YYYY/mm/dd</option>
</select>
<div class="jdpicker_w">
<p>Date:<input type="text" id="dt" size="30" class="jdpicker"/></p>
</div>
</form>
</body>
</html>
</pre>
//=================================================================================================
// JS file
//=================================================================================================
http://jdpicker.paulds.fr/?p=demo
I am using this datetime picker.
how to solve this issue?
Thanks,
Karthikeyan,Bangalore
-- modified 17-Feb-14 23:46pm.
|
|
|
|
|
Do you seriously expect anyone to try and plough through all this in order to figure out what you are asking? Please edit your question, remove all the non-relevant code, and provide a proper description of your problem.
|
|
|
|
|
Dear Sir/mam
i want to know how we can give the route map in any window app threw java script.I have already ask this question to my professor
so they tell me threw bing map.But i'm not able to understand how we can do? So please tell me about this.
|
|
|
|
|
|
Hi
I am new user, any one please help me, I want to add some radio button and append the value in sample.csv file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script language="javascript">
function WriteToFile(passForm) {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var fileLoc = "D:\\sample.csv";
var file = fso.openTextFile(fileLoc,8,true,0);
file.writeline(passForm.FirstName.value + ',' + passForm.LastName.value); // Add field nname
file.Close();
alert('File created successfully at location: ' + fileLoc);
}
</script>
</head>
<body>
<p>create a csv file with following details -</p>
<form>
Type your first name: <input type="text" name="FirstName" size="20"><br>
Type your last name: <input type="text" name="LastName" size="20"><br>
<input type="button" value="submit" onclick="WriteToFile(this.form)">
</form>
</body>
</html>
</br></br></html>
Thnaking You
Manish Kumar
Email abmanish71@gmail.com
|
|
|
|
|
For security reasons you can not access you operation system (including storage) from inside a JavaScript of you web page...
Running ActiveX is a very wrong way to do so - as
1. the client may allow access without really knowing what he's doing (the question about running ActiveX is not too informative)
2. it not works only in IE - that is a serious problem...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Hi I would like to retrieve and image from SQL table (blob) and display that image in html web page. I have create a handler to retrieve the image but am stuck on how to get into javascript. Any ideas?
here my handler...
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim ds As New DataSet()
Dim al As New ArrayList()
Using con As New SqlConnection(GetConnectionString("myconnection"))
Using cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "spRFIDocumentByRequestIDSelect"
cmd.Parameters.AddWithValue("@pRequestID", 531)
cmd.Connection = con
con.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader()
If sdr.HasRows Then
While sdr.Read()
al.Add(sdr(0).ToString())
al.Add(sdr(1).ToString())
al.Add(sdr(2).ToString())
context.Response.ContentType = "image/jpeg"
context.Response.Write(sdr(2))
End While
Else
al.Add("No Results")
End If
con.Close()
End Using
End Using
End Sub
and here is html and javascript...
<div id="fileDisplayArea"></div>
<script type="text/javascript">
$(document).ready(function () {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'GetImageHandler.ashx', true);
xhr.responseType = 'blob';
xhr.onload = function (e) {
if (this.status == 200) {
var blob = new Blob([this.response], { type: 'image/jpeg' });
var reader = new FileReader();
reader.onload = function (e) {
var thumbnail = reader.result;
fileDisplayArea.innerHTML = "";
var img = new Image();
img.src = reader.result;
alert(img.src);
fileDisplayArea.appendChild(img);
}
reader.readAsDataURL(blob);
}
};
xhr.send();
</script>
|
|
|
|
|
Is there a reason you're trying to load the image via javascript, instead of using the <img> tag?
<div id="fileDisplayArea">
<img src="GetImageHandler.ashx" />
</div>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Tried that the image doesn't display. I'm sure if I need to do something on the handler side or the javascript side to get the image in the correct format.
|
|
|
|
|
Try loading GetImage.ashx directly in the browser to see what you get. It's possible that you have an unhandled exception being thrown from your handler code, which would explain why your image isn't showing.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Please forgive me, but i'm not sure what you mean by "loading GetImage.ashx directly in the browser"
|
|
|
|
|
When you go to your web page, you'll see an address at the top of the browser. Delete the name of the page (everything after the last "/" character), and type GetImage.ashx on the end. Press the Enter key, and the browser should request your image handler.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That's pretty cool! I didn't know you could do that.
here is what I get...
System.Byte[]
|
|
|
|
|
OK, I see the problem. You're calling Response.Write , which accepts a String , but you're passing an array of Byte s. You need to call Response.BinaryWrite instead. If you have Option Strict turned on, you'll need to convert the Object to a Byte() first:
Dim imageBytes As Byte() = DirectCast(sdr(2), Byte())
context.Response.BinaryWrite(imageBytes)
Also:
- You should wrap the
SqlDataReader in a Using block. - You don't need to check
sdr.HasRows before calling the sdr.Read() method. - Since you're only returning one record, you can replace the
While sdr.Read() ... End While block with an If sdr.Read() Then ... End If block. - You should probably set the status code to
404 if you don't find an image to return. - I'm not sure what you're doing with the
ArrayList variable; you seem to store things in it, but never use it. You also have an unused DataSet variable at the top of your method.
The tidied-up version of your code is:
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Using con As New SqlConnection(GetConnectionString("myconnection"))
Using cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "spRFIDocumentByRequestIDSelect"
cmd.Parameters.AddWithValue("@pRequestID", 531)
cmd.Connection = con
con.Open()
Using sdr As SqlDataReader = cmd.ExecuteReader()
If srd.Read()
Dim imageBytes As Byte() = DirectCast(sdr(2), Byte())
context.Response.ContentType = "image/jpeg"
context.Response.BinaryWrite(imageBytes)
Else
context.Response.StatusCode = 404
End If
End Using
End Using
End Using
End Sub
Once your handler is returning the image properly, you can replace your original javascript function with a simple <img> tag as per my first answer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard, I just tried the similar thing and it worked...
|
|
|
|
|
hello i am use java script to change color at run time , But Problem is that when change color it set color at only one page from where i change color , How to set that color in all page ..?
I am using this code to change color
=========
var scrollHeight = '60px';
jQuery('#theme-change').click(function () {
if ($(this).attr("opened") && !$(this).attr("opening") && !$(this).attr("closing")) {
$(this).removeAttr("opened");
$(this).attr("closing", "1");
$("#theme-change").css("overflow", "hidden").animate({
width: '20px',
height: '22px',
'padding-top': '3px'
}, {
complete: function () {
$(this).removeAttr("closing");
$("#theme-change .settings").hide();
}
});
} else if (!$(this).attr("closing") && !$(this).attr("opening")) {
$(this).attr("opening", "1");
$("#theme-change").css("overflow", "visible").animate({
width: '226px',
height: scrollHeight,
'padding-top': '3px'
}, {
complete: function () {
$(this).removeAttr("opening");
$(this).attr("opened", 1);
}
});
$("#theme-change .settings").show();
}
});
jQuery('#theme-change .colors span').click(function () {
var color = $(this).attr("data-style");
setColor(color);
});
jQuery('#theme-change .layout input').change(function () {
setLayout();
});
var setColor = function (color) {
$('#style_color').attr("href", "css/style-" + color + ".css");
}
|
|
|
|
|
When you change the theme, you'll need to set a cookie. When the page loads, check to see if the cookie exists, and if it does, set the theme again based on the cookie value.
You can use the jQuery Cookie plugin[^] to create and read the cookie.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have to plane create a adblock system through the javascript. I am new one for this concept. Please anyone have any idea? Please guide me how to do this app.
|
|
|
|
|
You already asked this in the C++ forum; please do not crosspost the same questions.
Veni, vidi, abiit domum
|
|
|
|
|
|
Hello,
With JQuery, how can I copy items of one dropdownlist that have value starting with one word like "city/" to another dropdownllist?
Thanks
h.goli
|
|
|
|
|
You can - and Google can show you how exactly it's done, so...let me Google that for you[^].
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Hi guys, I have a static map (image) and I want to Have some items on it (div) showing a red dot, and on each red dot I show some details fetching by a JavaScript function from my database.
This Map has one level zoom.
Please Help me out or if you know of any tutorial please let me know
Thanxxxx
|
|
|
|
|
have you written any code for the same
|
|
|
|
|