|
JSON Tutor[^]
Please just go through JSON. I think that may be of some help
|
|
|
|
|
Hi,
I would like to check if a session has expired using Javascript without renewing the session.
Does anyone have any ideas?
Thank you
|
|
|
|
|
At the moment I have code that just before the session expires displays a message to the user asking them to confirm they are still there. This message is triggered using setTimeout() in JavaScript. From this point onwards I would like to call a server-side (c#) function to periodically check if the session has expired, until the session has expired. Is there a way I can call a server-side function from JavaScript without renewing the session?
I tried calling a [WebMethod] c# function but it seems these calls renew the session as it never replies that the session has expired.
Any help would be really appreciated.
Thank you,
Mel
|
|
|
|
|
guys, i use this code to get the the size of the file to upload
but i get the exception "Automation server can't create object"
function GetFileSize(filespec)
{
var filesystemobject = new ActiveXObject("Scripting.FileSystemObject");
var file = filesystemobject.GetFile(filespec);
return file.Size;
}
please, Help me.
Help people,so poeple can help you.
|
|
|
|
|
Did you try to google for an answer? On the first page I found this[^]
Wout Louwers
|
|
|
|
|
Sir, I put my path and server on the RemoteText.wsf file, but this didnt work.
<package>
<job>
<script language="VBScript">
set oController = CreateObject("WSHController")
set oProcess = oController.CreateScript("D:\Work\RemoteFile.wsf", "localhost")
WScript.ConnectObject oProcess, "remote_"
oProcess.Execute
While oProcess.Status <> 2
WScript.Sleep 100
WEnd
WScript.Echo "Done"
Sub remote_Error
Dim theError
Set theError = oProcess.Error
WScript.Echo "Error - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description
WScript.Quit -1
End Sub
</script>
</job>
</package>
Help people,so poeple can help you.
|
|
|
|
|
Did you try to register the WScript object as stated in the article?
Wout Louwers
|
|
|
|
|
ok, sir.
is there any way to obtain the file size other than ActiveX(Since ActiveX is not supported on operating systems other than windows)
Help people,so poeple can help you.
|
|
|
|
|
Not that I know of. Sorry.
Wout Louwers
|
|
|
|
|
Try this :
1. Go to internet explorer, Tools menu -> Internet options
2. Go to second tab -> Security
3. Enable ActiveX controls and plug ins options.
Hope this helps.
All the best.
|
|
|
|
|
thank you, sir;
but i don't think that ActiveX works on other browsers (like Fire Fox) or Operating Systems (like Linux) so, i quit using ActiveX.
100 , man.
Help people,so poeple can help you.
|
|
|
|
|
Hi there,
you got any workaround for this problem..? or any solution..??
i'm also facing the same problem..
|
|
|
|
|
no; sir.
Help people,so poeple can help you.
|
|
|
|
|
Hi guys,nice to meet you all,
i create a .js file which contains a formular:
Ext.onReady(function(){
var bd = Ext.getBody();
var text1=new Ext.form.TextField({
id :"Name",
fieldLabel: 'Name',
name: 'first',
width:190})
var text2=new Ext.form.TextField({
id :"CarteIdentité",
fieldLabel: 'N°CIN',
name: 'last',
width:190})
var text3= new Ext.form.TextField({
id :"Matricule",
fieldLabel: 'Matricule',
name: 'Matricule',
width:190})
var field = new Ext.form.FieldSet({
title: 'Contact Information',
autoHeight: true,
defaultType: 'textfield',
items:
[text1,
text2,
text3]
})
var form = new Ext.form.FormPanel({
defaultType: 'textfield',
bodyStyle:'padding:5px 5px 0',
items :field
});
var window = new Ext.Window({
width: 500,
height:300,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items: form,
buttons: [{
text: 'Valider',
handler : function ()
{
Ext.Ajax.request({
url: "../Application.aspx"
,params: {Action :'SaveData',
Name : document.getElementById("Name").value,
CarteIdentité : document.getElementById("CarteIdentité").value,
Matricule : document.getElementById("Matricule").value}
,method: 'post'
,success: function(response, opts)
{ Ext.MessageBox.alert('Successful!!!!!!!!!');}
,failure: function(){Ext.MessageBox.alert('Erreur');}
});
}
}]
})
window.show();
});
I developed with EXT.
when i run the project allways the faailure condition is declared
what is the problem?
I wanna know that the data i fill in the formular will be save in a database.I create .mdf database which contains a table (Name,CIN,Matricule)
How cani do that?
ty
|
|
|
|
|
What is error?
sunaSaRa Imdadhusen
+91 99095 44184
+91 02767 284464
|
|
|
|
|
Hello I am trying to validate a form that has many field on it.
<input type="text" name="sSoftwareType">
<input type="text" name="sSoftwareName">
<input type="file" name="sFileName">
The form itself validates itself by
<form enctype="multipart/form-data" name="Software" action="SoftwareUpdate.php" method="post" onSubmit="return Validate(this);">
The JavaScript validation code is
function Validate(f)
{
if (f.sSoftwareType.value == "")
{
f.sSoftwareType.focus();
return false;
}
if (f.sSoftwareName.value == "")
{
f.sSoftwareName.focus();
return false;
}
if (f.sFileName.value == "")
{
f.sFileName.focus();
return false;
}
}
All the input type text are validated fine, the problem is that the filename does not get validated, it is simply ignored.
All I want to do is verify that the file information was selected. ie the user did do a browse and click on a file that gets the data filled in on the form.
It would be nice to do other validation, but I would be happy if I could get help on this basic function.
Thank you in advance
modified on Saturday, February 5, 2011 9:56 PM
|
|
|
|
|
I'm not quite sure where your issues are. I put this sample code together and it works great in IE8:
<html>
<body>
<form enctype="multipart/form-data" name="Software" action="SoftwareUpdate.php" method="post" onSubmit="return Validate(this);">
<input type="file" name="sFileName" value=""/>
<input type="text" name="sSoftwareType"/>
<input type="text" name="sSoftwareName"/>
<br/>
<input type="submit" name="Hello" value="Go!">
</form>
<script type="text/javascript">
function Validate(f)
{
alert(f.sFileName.value == "");
return false;
}
function Validate(f)
{
if (f.sSoftwareType.value == "")
{
f.sSoftwareType.focus();
return false;
}
if (f.sSoftwareName.value == "")
{
f.sSoftwareName.focus();
return false;
}
if (f.sFileName.value == "")
{
f.sFileName.focus();
return false;
}
}
</script>
</body>
</html>
Works like a charm!
|
|
|
|
|
Hello Thank you for your time.
Yes your example worked just fine.
Reviewing the code that I'm upgrading I fine that there was a line
<!-- <input type="hidden" name="sFileName" value="<?php echo $sFileName;?>" />-->
Right after the form declaration and before the list of inputs, So obviously there was no way to set a focus to this.
Not sure why the person would have done this. Do you think the intention was so the the user could update other information without uploading a new file? if so then I guess two variable names should have been used for sFileName.
Question, in your example your gave two functions of Validate(f), I assume I would only use one of the two.
Again Thank you
|
|
|
|
|
My bad! The first function was there for test purposes and I forgot to comment it (or omit it) when I copied the pieces from my test page together for the sample I posted.
Is your issue solved then?
|
|
|
|
|
Hello yes, but it leads to a new one
<html>
<body>
<?php $sFileName="";?>
<form enctype="multipart/form-data" name="Software" action="SoftwareUpdate.php" method="post" onSubmit="return Validate(this);">
<input type="hidden" name="sFileName" value="<?php echo $sFileName;?>" />
<input type="file" name="sFileName" value=""/>
<input type="text" name="sSoftwareType"/>
<input type="text" name="sSoftwareName"/>
<br/>
<input type="submit" name="Hello" value="Go!">
</form>
<script type="text/javascript">
function Validate(f)
{
if (f.sSoftwareType.value == "")
{
f.sSoftwareType.focus();
return false;
}
if (f.sSoftwareName.value == "")
{
f.sSoftwareName.focus();
return false;
}
if (f.sFileName.value == "")
{
f.sFileName.focus();
return false;
}
}
</script>
</body>
</html>
by having the
<input type="hidden" name="sFileName" value="<?php echo $sFileName;?>" />
If I remove this code then the _POST doesn't happen in the SoftwareUpdate.php file.
I will have to do create a smaller SoftwareUpdate file and see if I can figure it out.
Do you know why the person would have done this double input on the sFileName?
|
|
|
|
|
AFAIK it is perfectly legal to use one parameter more than once. I've encountered this during a code review in 1999 and it did make sense then even if I can't recount the exact usage pattern. Most of the times though it's just a f**kup of some kind or another.
From what you posted sofar it seems to me you are stuck with code that was programmed by some other person. The problem here is if it is a big messy pile of code your best bet would be to start refactoring it.
|
|
|
|
|
I need something relatively light weight that enables me to write, run and debug JS code. Any thoughts on the best tools? The idea of using VS/FireFox/Venkmann or equivalent leaves me a bit cold.
Thx++
Jerry
|
|
|
|
|
Never used it, but now i have found it, i think i will take it for a spin.
Aptana Studio[^]
|
|
|
|
|
I've tried Aptana Studio out and found it awesome, but not exactly lightweight
|
|
|
|
|
I have been using firefox with the firebug addon and I have been happy.
Chris J
www.redash.org
|
|
|
|