?
Solved

Census Forms for submission

Posted on 2006-05-19
8
Medium Priority
?
144 Views
Last Modified: 2010-05-01
Hi Folks  

Got a hard one for you.  I am trying to create a VB/Web page that when a user logs into thier machine, it checks for a flag on their PC, and if it isnt present, it brings up a form for them to fill in with details such as user name, pc assett number etc etc etc.  I want to then have a submit button which when pressed, emails the form to a mailbox and places a flag file on the PC.  Anyone came across this sort of thing before?

Many many thanks
0
Comment
Question by:stefanjoc
  • 4
  • 4
8 Comments
 
LVL 23

Expert Comment

by:basicinstinct
ID: 16717250
Why don't you just set a cookie on the machine and use that as your flag - easy peasy.
0
 

Author Comment

by:stefanjoc
ID: 16717262
Was hoping for a little more help on the form?  And how to set the form up to copy a file to the machine to say it has been submitted?
0
 
LVL 23

Expert Comment

by:basicinstinct
ID: 16717280
ok, no problem - what technologies can we use?  Plain HTML / Javascript / ASP???
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:stefanjoc
ID: 16717316
Any technology you like :-)  
0
 
LVL 23

Accepted Solution

by:
basicinstinct earned 2000 total points
ID: 16717652
Well, here is a bare bones implementation in plain old HTML/Javascript.

Possible drawbacks to this approach:  coookies can be disabled; cookeis can be deleted.

I have used the silly old "mailto" on form submit, but in reality you would probably couple it to your server side technology.  I personally run JSP pages on Apache/Tomcat using MySql database backend (ie, I use LAMJ - Linux Apache MySql JSP).

Anywho, take a look at the test page, it is basic, but I think this is essentially what you were looking for...?  No? Yes? Maybe?
(Copy the code below, paste it into an empty text file, save the file as "test.html" and open it in your browser...)

<html>
      <head>
            <script language="JavaScript">
                  function firstVisit()
                  {
                        var first = !document.cookie;
                        if(first)
                        {
                              setCookie();
                        }
                        else
                        {
                              alert("You have already submitted your survey.")
                        }
                        
                        return first;
                  }
                  function setCookie()
                  {
                        document.cookie = "hasVisited = true; expires = Thu,31-Dec-2020 00:00:00 GMT;"
                  }
            </script>
      </head>
      <body>
            <form id="census" method="post" action="mailto:someguy@someplace.com" enctype="text/plain">
                  <input type="text" id="Question1" name="Question1"/>
                  <input type="text" id="Question2" name="Question2"/>
                  <input type="text" id="Question3" name="Question3"/>
                  <input type="submit" onclick ="return firstVisit();"/>
            </form>
      </body>
</html>
0
 

Author Comment

by:stefanjoc
ID: 16733194
There were a few errors on that page when I copied it into Explorer.  What I have decided to do, is an access database with a web front end.  Only problem is, I want a VB script to copy a text file from one place to another, and close Internet Explorer.  Anyone know how to do that?
0
 

Author Comment

by:stefanjoc
ID: 16734382
Thanks alot mate.  This did the job very nicely.
0
 
LVL 23

Expert Comment

by:basicinstinct
ID: 16740582
SWEET!
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question