|
I wrote this on the fly.
function checkForm(formID)
{
var data = new Array();
var form = document.getElementById(formID);
for (var i = 0; i < form.elements.length; i++)
{
if(form.elements[i].value != "")
data[form.elements[i].name] = form.elements[i].value;
else
return 0;
}
return data;
}
It "should" work for both input and select which will save you the hastle of doing each seperatly
hmmm pie
|
|
|
|
|
Hi there - cheers for getting back to me. The form checking that you provided is awesome, and much quicker than the way I was going to be doing it!!!
Unfortunately the array bit doesnt work. Im returning the 'data' array to another function and when I try to alert the contents it comes up with nothing.....no matter how I try to get at the content. Presumably the array should contain my seven form field values along with the relevant field name keys but I cant get at any of it.
No errors are thrown and eveything looks like it should be working.
Any ideas?
Again, cheers for getting back to me so quickly! 
|
|
|
|
|
alert(data) will not work, but alert(data['anExampleFieldName']) will.
If you try and go through the array using indexing then it won't work either
Edit: Have you tried using the Firefox[^] Add-on called Firebug[^] which has a very useful JavaScript debugger.
hmmm pie
modified on Tuesday, March 17, 2009 12:07 PM
|
|
|
|
|
Alternativley if you want to use indexing then you can use a 2d array.
var data = new Array()
for (var i = 0; i < LENGTH; i++)
{
if(notEmpty)
{
data[i] = new Array(2);
data[i][0] = name;
data[i][1] = value;
}
}
That will be able to use indexing, although the structure is not what you previously asked for.
hmmm pie
|
|
|
|
|
Hi Friends,
I am using IIS Server with ASP, my mail code doesn't work whenever i send a mail it will go only Queue's folder it will not deliver.., but this code work well in my friend PC.
my OS Windows XP
Here My code
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="dmanivelan@siminfosystems.com"
myMail.To="dmanivelan@siminfosystems.com"
myMail.Bcc="dmanivelan@siminfosystems.com"
myMail.Cc="dmanivelan@siminfosystems.com"
myMail.TextBody="Testing." & Time
myMail.Send
set myMail=nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
Please Reply immediately...
modified on Monday, March 16, 2009 11:07 AM
|
|
|
|
|
|
Hi, You are sending IIS configuraion IIS 6.0 but i was working with IIS 5.1. it will support IIS 5.1
|
|
|
|
|
|
I Change the setting but still same problem.. mail goes to queue folder any other way..
|
|
|
|
|
It could be that your ISP is blocking mail going out from your local server, or other things really hard to say without seeing the configuration. You could however try to use an outside mail server if you have one and set CDOSYS to authenticate like the following:
Set myMail = CreateObject("CDO.Message")
//now set the mail server
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.yourdomain.com"
//set the port
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
//set code to authenticate
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
//set the email address for authentication
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username@yourdomain.com"
//set password for authentication
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
myMail.Subject="Sending email with CDO"
myMail.From="dmanivelan@siminfosystems.com"
myMail.To="dmanivelan@siminfosystems.com"
myMail.Bcc="dmanivelan@siminfosystems.com"
myMail.Cc="dmanivelan@siminfosystems.com"
myMail.TextBody="Testing." & Time
myMail.Send
set myMail=nothing
Let me know if that helps.
Matthew Vass
QA Analyst
mvass@hostmysite.com
http://www.hostmysite.com?utm_source=bb[^]
|
|
|
|
|
Hi, Again same problems.. mails sent in QUEUE folder
|
|
|
|
|
Ok i was getting the same issue as you when using XP and localhost for smtp relay. I think i may have missed something in my original code snippet, but i did test this on my local and got this working hopefully this will help with your issue.
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="matt@xynergypc.com"
myMail.To="livenitup603@yahoo.com"
myMail.TextBody="This is a message."
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="youremailserver"
'Server port
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
'authenticate
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'email address for authentication
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youremailaddresshere"
'email password
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "youremailpasswordhere"
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
|
|
|
|
|
Hi friend,
error '80040211'
"myMail.Send"
/ASP/Sim File/MailCode/NewMail.asp, line 71
i am getting error this line "myMail.Send"
|
|
|
|
|
This usually means that your unable to send mail via that smtp relay.
1. does your email/website provider allow smtp relay?
2. do you login to your email with your full email address or just username
Basically the cdosys script is working but unable to connect to the email server for what ever reason. If your mail server doesn't require authentication (although all most do) then you will not need the username/email address and password. If they do require authentication you will need to make sure that the username/email address and password are correct as well as the server name and port. If all that information is correct you may want to ensure you can send mail on port 25. To do that you can try and telnet to your mail server on port 25, if this doesn't connect try port 50. The default smtp mail port is 25, but there usually is always an alternate port such as with our company which is port 50. If neither of these work then you should contact your email provider and find out what ports they allow smtp relay on, that is if they do.
Hope this helps.
|
|
|
|
|
My asp.net application is ajax enabled. After the page is loaded completely, if there is no user activity for sometime, the screen stops responding until i close the browser and open it again.
In some of the screens, on Session timeout (i have tested it by keeping the screens idle for 20 minutes), the user is redirected to the login page.
But on few screens, the redirect does not happen. The screen stands still and no buttons links on the page respond to any mouse or keyboard event.
At this point, if i press the "Refresh" button on the browser address bar, then i get logged out of the application and redirected to the login page.
On the browser Status bar (bottom left hand corner of the browser window) a javascript error message displayed as "Error on Page" instead of "Done".
On click of it, following error messages can be seen in the javascript error message pop-up.
Unexpected ajax response was received from the Server
This may be caused by one of the following reasons:
Server.Transfer
Custom Http handler
Incorrect loading of an "Ajaxified" user control
Verify that you don't get a server side exception or any other undesired behavior, by setting the EnableAJAX property to false.
not possible to add the screen shots, else wd have done.
All the pages and user controls in my application follow the same ajax panel structure and loading.
|
|
|
|
|
without connecting to internet, is it possible to test email / autogenerate emails using "localhost"?
|
|
|
|
|
If you have a local smtp server. There are other programs that fake this but you'll have to do some searching.
|
|
|
|
|
|
Neonlight and Matthew, thanks for the response. I shall get back to you.
|
|
|
|
|
Hi,
I need to find a way to detect which PHYSICAL key is pressed, using Javascript. The best that JS can offer, as far as I can see, is finding the Virtual Key code of a key (With onkeyup/onkeydown), which doesn't always map to the same physical key (For example, the key under 6 and 7 on the US keyboard is Y and sends DOM_VK_Y virtual key code, but in the German layout it's Z and it sends DOM_VK_Z). Those VKs would be enough info if I knew which keyboard layout the user is using.
Some background on keyboard layouts, because this is a confusing subject: A keyboard sends a scan code, which is more or less standardized across all "normal" keyboards, so that key under 6 and 7 (The US layout Y and German Z) always sends the same code. The OS (Let's say Windows) translates that into a Virtual Key code, that in case of the latin letters is usually the same as the ASCII code for the letter on the key, but really doesn't have to be the same, and with non-latin-script languages, it isn't. You can look up VK_* constants in Win32 API. That translation is dependent upon the current layout. From there, the VKs are translated to characters, again, according to the keyboard layout.
If I get the VKs (easy part) plus know the current layout (what I'm asking), then I can check the tables and see what physical key was pressed. I'm also open to other methods I may not have thought about.
What I have already tried:
1. Flash - Tried using ActionScript functions to get the browser's current keyboard layout. Can't be done. Tried using Flash's keyboard events to get the scan codes (Windows' WM_CHAR and the likes have that info in them), but Flash doesn't supply that info. I might have missed something there, because I couldn't find good documentation on the subject.
2. Java Applets - Since the Java plugin gets loaded once per browser session, I can only get the layout the browser process had when when a Java applet was first called, and who knows when that was. Changing the layout in the browser doesn't affect the layout in the Java plugin, so there's no way to tell what happened since Java was first loaded. I used java.awt.im.InputContext.getInstance().getLocale(). Using a Java textbox instead of an HTML element is out of the question for various reasons.
3. JS dispatchEvent/fireEvent - Tried to see if I can emulate the pressing of certain VKs and see what Unicode chars they generate, and try to guess the layout from that. Unfortunately, Javascript can't really emulate keystrokes, just single events, so onkeydown (That has VK info) didn't cause onkeypress (That has char code info) to be generated, so that can't be used.
At that point my ideas ran dry. I hope that listing them here would at least help someone else think of something...
Thank you!
|
|
|
|
|
how to execute php code from mysql (phpmyadmin)?
Thanks
|
|
|
|
|
Why do you want to do that ?
It's not a recommended way !
You ought to find other ways for it
|
|
|
|
|
It is possible - but i can't remember the function that lets you run stored code. Still , I think you're better off finding another way too though. Why not just make a function and grab individual bits of the database as & when you need them.
|
|
|
|
|
Thanks from your comments and kind guidance.
i found the solution there is a specific function for it
eval()
Thanks
|
|
|
|
|