|
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
|
|
|
|
|
firebug is better i think. you can also try JavaScript Debugger add-on.
|
|
|
|
|
I hope this is the right place for this. I've been looking for quite a while for something remotely similar to what I would like to do and no such luck (probably looking for the wrong thing). I'm just learning PHP and haven't done anything in Javascript in about 10 years so I'm beyond rusty
I'm building a calendar and what I want to do is get the navigation to work to move forward and backwards through the month. I kinda have it working in PHP but it's getting convoluted, and with the searching I've been doing a lot of people are saying to use Javascript. Only problem is I can't seem to find anything as far as examples go. I basically need to send a few variables to the next page based on which of the two buttons I select. Anyone know where I can find a good article? I either need to send the motifiers for the month and year or the new month and year.
Thanks in advance!!
|
|
|
|
|
You can send values from one page to another by either a get or a post. A get is just added to the link and a post can be down by making it use hidden inputs and javascript to fill in the selected values and form submition.
Hope that helps.
Chris J
www.redash.org
|
|
|
|
|
Good points but I haven't done lore than about 50 hours of web programming since 2001 so lets see if I got this right. Are you saying to use the javascript on (lets say) the new form vs the original? The way I have it now is "calendar" is based off the current Date to populate the calendar grid. If you choose Next Month it goes to calendar3 which processes the to procedure to add one month. If you choose the previous button it goes to calendar2 which processes the procedure to subtract one month. This is resulting in a lot of duplicate code. However if I can do the work within in javascript I can keep all the code centralized and just pass over the "new date". Maybe I can do that now but I'm not sure (new guy problem), but I'd still have 3 pages vs maybe 1 or 2. I'm thinking it would be more like "if buttonNext is clicked do this, else do this" (this is how I did it in ASP, but my boss refuses to run IIS so I had to scrap that project and go to PHP and apparently Javascript). I'm not seeing a way of doing that in PHP thus the reason I'm looking to javascript. Does that help describe my problem better?
|
|
|
|
|
It can be done in php. Try making a test project in php that has the basic function of what you are trying to do. For example have a counter with a plus and minus button, and a input field to hold a value.
I will give you a sample form to play with.
<?php
if(isset($_POST))
{
if($_POST['action']=='+')
{
$counter++;
}
else if($_POST['action']=='-')
{
$counter--;
}
else
{
}
}
else
{
$counter = 0;
}
echo "<form action='' method='post'>";
echo "<input type='submit' name='action' value='+'>";
echo "<input type='text' value='".$counter."' name='counter'>";
echo "<input type='submit' name='action' value='-'>";
echo "</form>"
?>
This should increase or decrease the counter with each click of the buttons + or -. This behaviour is like the next or prior month buttons your wrote about. You will of course need to add bound checking for the months.
If you get this going you should be able to expand on it to handle the calander.
Chris J
www.redash.org
|
|
|
|
|
Sorry for the delay, we've been having some bad network issues (bad router). I finally have some time to look at this. Looks pretty straight forward, but I'll let you know if I have any more questions.
|
|
|
|