|
Chiari wrote:
My datagrid id is 'dgStkcode' and the id/name of the control inside this datagrid is 'EditAsCast'...
Basically, you can use the getElementById method to get reference to an html element at the client side based on its id. To know exactly what the id of the input textbox is, you simply view source the web page in the browser. In fact, this value is the value of the ClientID property of the control.
Chiari wrote:
It return [object] to me. Does this means it got the id of the datagrid?
It means the method found an object whose id is the dgStkcode .
How do you get the value of the input textbox to validate btw?
|
|
|
|
|
I passed in the parameter to it when calling the function.
onblur="return vldValue(this.value)"
Chiari
|
|
|
|
|
You'd better pass the object (this) instead of its value (this.value) as the method parameter so that you can use the object to change the background color without having to retry to get reference to the control again. The sample code looks something like:
....onblur="return vldValue(this)"....
function vldValue(obj)
{
var value = obj.value;
....
if(!isValid)
obj.style.backgroundColor = "red";
...
}
|
|
|
|
|
Hi,
Your advice really help me a lot. I'm able to get the reference to the control.
Thanks a lot,
Chiari
|
|
|
|
|
I found this bug in my javascript form,which is Data Entry form which send info to MS Outlook and send the mail,when trying to enter a semicolon(") in the textbox,MS outlook returns this error.
"The command line argument is not valid.Verify the switch you are using"
Can anyone solve this?
-- modified at 3:13 Thursday 29th September, 2005
|
|
|
|
|
Could it be because semi-colon usually denotes end of a line in javascript, thus the script thinks that the line ends with the semi-colon and then tries to interprete the following text as code lines?
Try escaping your semi-colon and see what it does.
---------------------------
127.0.0.1 - Sweet 127.0.0.1
|
|
|
|
|
The whole form works perfectly without the semi-colons,when i tried entering one semi-colon,all data(below the form) that was suppose to appear, all gone under the MS outlook.
|
|
|
|
|
This (") is not a semicolon ( ; ), it is a quote.
Quotes are probably used around the value when it's sent as a string value. In that case you have to escape the quotes in the value. How that is done depends on how you are sending the data.
---
b { font-weight: normal; }
|
|
|
|
|
How can i solve this problem? I have a send Mail function was sends data through this code from form to Outlook:
isBody += "Employee Name: " + isForm.personal.value +"%0D%0A";
document.forms.Send.action = "mailto:"+recipient+"?subject="+isSubject+"&body="+isBody+" ";
isForm = Form name
personal.value = textbox field name
|
|
|
|
|
Use the escape() function on the values. That will url encode the characters that needs encoding.
---
b { font-weight: normal; }
|
|
|
|
|
Can u quote me an example???
|
|
|
|
|
isBody += "Employee Name: " + isForm.personal.value +"%0D%0A";<br />
document.forms.Send.action = "mailto:"+escape(recipient)+"?subject="+escape(isSubject)+"&body="+escape(isBody)+" ";
---
b { font-weight: normal; }
|
|
|
|
|
Hi there!
I am trying to save different .swf files on my local machine.
Actually this is already working with the below code.
Unfortunately (how I already figured while writing the code) The file is saved, but somehow corrupted.
Is there maybe a way more simple way to get the Response of an URI into a string (or, let's say a buffer) and save it on my disk?
Below is the code I came up with (within a C# web application):
// init
bool debug = false;
// this is where I get my test-swf, you can have a look at it at:
// http://www.styte.com/3.swf
// it may look strange, what I am trying to do is to read some php-created
// swf's into my .net application....
string url = "http://www.styte.com/trans.php?&bild=3.swf";
// work
Uri fileUrl = new Uri(url);
// Create 'FileWebrequest' object with specified Uri.
WebRequest myFileWebRequest = (WebRequest)WebRequest.Create(fileUrl);
// Send 'FileWebRequest' object & wait for response.
WebResponse myFileWebResponse = (WebResponse)myFileWebRequest.GetResponse();
// Get stream object associated with response object.
Stream receiveStream = myFileWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("windows-1252"); //("utf-8");
// Pipe stream to higher level stream reader with req. encoding format.
StreamReader readStream = new StreamReader (receiveStream, encode);
if (debug==true) Response.Write("\r\nResponse stream received<br>");
int numChars = 1;
Char[] read = new Char[numChars];
// Read "numChars" characters at a time.
int count = readStream.Read ( read, 0, numChars );
if (debug==true) Response.Write("(count): "+count.ToString()+" File Data...\r\n");
//Response.ContentType = "application/x-shockwave-flash";
//Response.AddHeader("Content-Type", "application/x-shockwave-flash");
FileStream fs = File.Create(@"C:\Inetpub\wwwroot\leilac\uploads\test.swf");
BinaryWriter bw = new BinaryWriter(fs);
while (count > 0) {
String str = new String(read, 0, count);
bw.Write(str);
Response.Write(str);
count = readStream.Read(read, 0, numChars);
}
bw.Close(); fs.Close();
if (debug==true) Response.Write("<br>");
// Release resources of stream & response object.
readStream.Close();
myFileWebResponse.Close();
Response.End();
Appreciate any comments/help.
Sascha Stanscheit, styte, http://www.styte.com/
|
|
|
|
|
Please don't double post.
---
b { font-weight: normal; }
|
|
|
|
|
Trying to replace certain value.
my Sql statment..
spGetPOListPageing'-1', '-1', '-1', '-1', '-1', '12', '-1', '01/01/1900', '01/01/1900', '01/01/1900', '01/01/1900', 'rprmen',4,117,30
What I need to do is replace 117 with a new page number (may be 1 or 234 or 45). Right now I have it like this
NewSql = Left( Sql, Len(str)-4 ) & currentPage & Right(Sql, 3)
But if I have 2234 pages then I will have problem. How can i replace the value from the second last comma to the last comma (in between)? for example I like to replace 1173 with 22. Like this
spGetPOListPageing'-1', '-1', '-1', '-1', '-1', '12', '-1', '01/01/1900', '01/01/1900', '01/01/1900', '01/01/1900', 'sabu.stephen',4,22,30
Please help
Thanks
BJ
|
|
|
|
|
Why not put the correct value in the string when you create it?
---
b { font-weight: normal; }
|
|
|
|
|
Could use Split(",") and work on the string in the second to last index, or use the indexOf(",117,") and then use substring....or you could write your own method to find the second to last comma, (even sounds like a good chance to use recursion....)
Brian Van Beek
Here's my boring blog! [^]
|
|
|
|
|
Hello,
I need javascript function which take two parameters(dates) and return total years and months difference.
Regards
Tariq mahmood
|
|
|
|
|
You have to specify more clearly what you want.
Do you want the difference in years and months separately, or the difference in month expressed as years and months?
Also, should the difference in months be calculated as the difference in whole months between the dates, or only based on the month of the dates.
---
b { font-weight: normal; }
|
|
|
|
|
I have developed a website using ASP , I'm new to this program , could you all advice me how can I disable the back button on the ie on my home page because when user click back buton they directed to the previous page which they veiwed earlier . but I don't want it happen .They should redirect to atleast " Warning: Page has Expired " or to disable the back button .
thanks in earlier .
Rgds
theepa
|
|
|
|
|
try using either of these javascript code examples (note: location.replace will not let you go back to the original page.)
<a href="somwhere.asp" onclick="location.replace(this.href);return false;">TEST</a>
or put this on the page you don't want your user going back to:
onLoad="if(history.length>0)history.go(+1)"
Brian Van Beek
Here's my boring blog! [^]
-- modified at 17:25 Wednesday 28th September, 2005
|
|
|
|
|
Hi there,
You basically cannot disable the Back button in the browser. To work around this issue, you either use javascript and play around with the history object like Brian suggested or place a snippet of code in the asp page to prevent caching[^] at the client side.
|
|
|
|
|
hi
help me..........
i have a php project and want convert it to asp.net
please help me for convert this project.
|
|
|
|
|
you can use this url for convert php, asp and jsp to aps.net
http://www.asp.net/MigrationAssistants/Default.aspx?tabindex=0&tabid=1
|
|
|
|
|
I want to be able to change the culture for a page by pressing an image button with a countries flag, but I'm having problems in that it appears to be ignoring my settings. It works using a dropdown list. Here code sample:-
<%@ Page Language="C#" uiculture="auto" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Globalization" %>
protected override void InitializeCulture()
{
if (Request.Form["ListBox1"] != null)
{
String selectedLanguage = Request.Form["ListBox1"];
UICulture = selectedLanguage;
Culture = selectedLanguage ;
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);
}
base.InitializeCulture();
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
ListBox1.Text = "en-GB";
InitializeCulture();
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
ListBox1.Text = "es-MX";
InitializeCulture();
}
<asp:listbox id="ListBox1" runat="server" meta:resourcekey="ListBox1Resource1">
<asp:listitem value="en-GB"
="" selected="True" meta:resourcekey="ListItemResource1">English
<asp:listitem value="es-MX" meta:resourcekey="ListItemResource2">Español
<asp:listitem value="de-DE" meta:resourcekey="ListItemResource3">Deutsch
<asp:button id="Button1" runat="server"
="" text="Set Language" meta:resourcekey="Button1">
<asp:imagebutton id="ImageButton1" runat="server" imageurl="~/unionjack.gif" height="50px" onclick="ImageButton1_Click" width="100px">
<asp:imagebutton id="ImageButton2" runat="server" height="50px" imageurl="~/spanish_flag.jpg" width="100px" onclick="ImageButton2_Click">
<asp:label id="Label1" runat="server"
="" meta:resourcekey="Label1">
Clueless
|
|
|
|