home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************\
- * *
- * Guest.jfm -- Guest Book Entry Form *
- * *
- * Guest.jfm is part of the Guest Book solution application. It is the first *
- * form that the user encounters. They can enter their name, email address, *
- * comment, etc. and then submit a guest book entry. They can skip that and *
- * just view the existing entries by selecting the appropriate link. After *
- * the submission, the thanks form is displayed (see the *
- * submitButton_OnServerClick() method to see how this is done). *
- * *
- * Dependencies: gestbk31.gif *
- * homepg31.gif *
- * apps/shared/controls.cc *
- * *
- * Links to: ibapps/index.htm *
- * svr/intrasrv.isv?apps/guestbk/entries.jrp(1,1) *
- * *
- * Updated 11/12/96 by IntraBuilder Samples Group *
- * $Revision: 1.13 $ *
- * *
- * Copyright (c) 1996, Borland International, Inc. All rights reserved. *
- * *
- \****************************************************************************/
-
- // {End Header} Do not remove this comment//
- // Generated on 11/12/96
- //
- var f = new guestForm();
- f.open();
- class guestForm extends Form {
- _sys.scripts.load(_sys.env.home() + "APPS\\SHARED\\CONTROLS.CC")
- with (this) {
- onServerLoad = class::Form_onServerLoad;
- color = "a4d5ff";
- height = 15;
- left = 0;
- top = 0;
- width = 72;
- title = "Guest Book";
- }
-
-
- with (this.ibapps1 = new Database()){
- left = 22;
- top = 2;
- databaseName = "IBAPPS";
- active = true;
-
- }
-
- with (this.guest1 = new Query()){
- left = 26;
- top = 2;
- database = parent.ibapps1;
- sql = "select * from guest";
-
-
- with (rowset) {
-
-
- }
-
- }
-
- with (this.rule1 = new Rule(this)){
- top = 4;
- size = 2;
- right = 70;
-
- }
-
- with (this.rule2 = new Rule(this)){
- top = 19;
- size = 2;
- right = 70;
-
- }
-
- with (this.rule3 = new Rule(this)){
- top = 28;
- size = 2;
- right = 70;
-
- }
-
- with (this.guestBookLogo = new Image(this)){
- height = 3.4167;
- width = 10.25;
- dataSource = "filename GESTBK31.GIF";
- alignment = 4;
-
- }
-
- with (this.titleHTML = new HTML(this)){
- height = 2;
- left = 12;
- width = 58;
- color = "steelblue";
- text = '<H1><FONT SIZE="+4"><FONT COLOR="mediumvioletred">G</FONT></FONT>uest <FONT SIZE="+4"><FONT COLOR="mediumvioletred">B</FONT></FONT>ook</H1>';
-
- }
-
- with (this.invitationHTML = new HTML(this)){
- height = 2;
- top = 5;
- width = 70;
- color = "black";
- text = "We're glad you visited our site today. Please be kind enough to leave a record of your visit. Comments and suggestions are always welcome.";
-
- }
-
- with (this.fullnameHTML = new HTML(this)){
- height = 1;
- top = 7;
- width = 22;
- color = "black";
- text = "Your full name";
-
- }
-
- with (this.fullnameText = new Text(this)){
- left = 22;
- top = 7;
- width = 34;
- value = "";
-
- }
-
- with (this.emailHTML = new HTML(this)){
- height = 1;
- top = 8;
- width = 22;
- color = "black";
- text = "Email address";
-
- }
-
- with (this.emailText = new Text(this)){
- left = 22;
- top = 8;
- width = 34;
- value = "";
-
- }
-
- with (this.wherefromHTML = new HTML(this)){
- height = 1;
- top = 9;
- width = 22;
- color = "black";
- text = "Where are you from?";
-
- }
-
- with (this.wherefromText = new Text(this)){
- left = 22;
- top = 9;
- width = 34;
- value = "";
-
- }
-
- with (this.firstVisitCheck = new CheckBox(this)){
- height = 1;
- top = 10;
- width = 56;
- text = "Is this your first visit?";
- checked = false;
-
- }
-
- with (this.commentsHTML = new HTML(this)){
- height = 1;
- top = 11;
- width = 22;
- color = "black";
- text = "Comments";
-
- }
-
- with (this.commentsTextArea = new TextArea(this)){
- height = 5;
- top = 12;
- width = 60;
- value = "";
-
- }
-
- with (this.submitButton = new Button(this)){
- onServerClick = class::SubmitButton_onServerClick;
- top = 17.5;
- width = 10.5;
- text = "Submit";
-
- }
-
- with (this.resetButton = new Reset(this)){
- left = 16;
- top = 17.5;
- width = 9;
- text = "Clear";
-
- }
-
- with (this.guestBookLinkImage = new Image(this)){
- onImageClick = class::link_to_entries_page;
- height = 3.4167;
- top = 20;
- width = 10.25;
- dataSource = "filename GESTBK31.GIF";
- alignment = 4;
-
- }
-
- with (this.guestBookLinkHTML = new HTML(this)){
- height = 1;
- left = 12;
- top = 20;
- width = 58;
- color = "black";
- text = "<A HREF='/svr/intrasrv.isv?apps/guestbk/entries.jrp(1,1)'>View Current Guest Book Entries</A>";
-
- }
-
- with (this.homePageLinkImage = new Image(this)){
- onImageClick = class::link_to_home_page;
- height = 3.4167;
- top = 24;
- width = 10.25;
- dataSource = "filename HOMEPG31.GIF";
- alignment = 4;
-
- }
-
- with (this.homePageLinkHTML = new HTML(this)){
- height = 1;
- left = 12;
- top = 24;
- width = 58;
- color = "black";
- text = "<A HREF='/ibapps/index.htm'>Return to Home Page</A>";
-
- }
-
- with (this.generatedHTML1 = new GeneratedHTML(this)){
- height = 1;
- top = 28.5;
- width = 70;
-
- }
- this.rowset = this.guest1.rowset;
-
- function Form_onServerLoad() {
- // set default value of fields to something large
- this.fullnameText.value = new StringEx().replicate(' ',100);
- this.emailText.value = new StringEx().replicate(' ',100);
- this.wherefromText.value = new StringEx().replicate(' ',100);
- }
-
- function SubmitButton_onServerClick()
- {
- // make the guest query active
- this.form.guest1.active = true;
- // store the form's values to the table
- this.form.guest1.rowset.beginAppend();
- this.form.guest1.rowset.fields["VisitTime"].value = new Date();
- this.form.guest1.rowset.fields["Fullname"].value = this.form.fullnameText.value;
- this.form.guest1.rowset.fields["Email"].value = this.form.emailText.value;
- this.form.guest1.rowset.fields["WhereFrom"].value = this.form.wherefromText.value;
- this.form.guest1.rowset.fields["FirstVisit"].value = this.form.firstVisitCheck.checked;
- this.form.guest1.rowset.fields["Comment"].value = this.form.commentsTextArea.value;
- // save the new row
- this.form.guest1.rowset.save();
- // end with the thank you form
- _sys.forms.run("thanks.jfm");
- }
-
- function link_to_home_page()
- {
- location.href="/ibapps/index.htm";
- }
-
- function link_to_entries_page()
- {
- location.href="/svr/intrasrv.isv?apps/guestbk/entries.jrp(1,1)";
- }
-
- }
-