The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

2 Pages V < 1 2  
Reply to this topicStart new topic
> Can HTML <Select> process a not found in list.
CharlesEF
post Apr 2 2018, 07:09 PM
Post #21


Programming Fanatic
********

Group: Members
Posts: 1,544
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Hey, I'm old. I started programming RPG on a IBM System 3 mainframe. PC's weren't invented yet. I use modal popups (the popup will never lose focus) in many of my apps also and any code after opening the popup will execute. But, that code has nothing to do with the response from a user who uses that popup. To use the response from the user you would need to call a different function.

Your <<<< comments are correct. The 'confirm' command is what provides the wait. Once the user clicks something the remaining code is run (code that matches user response).

I don't do jQuery either so it wouldn't do any good to send me any.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Apr 2 2018, 07:21 PM
Post #22


Programming Fanatic
********

Group: Members
Posts: 1,544
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Attached is a sample page with a modal popup (that's what I call it). In the zip file is the original combobox.html with a few slight changes. Open 'selects.html' in your browser and add an item to any of the selects.

Does your current web host provide mysql databases? Or maybe you have a different database.
Attached File  temp.zip ( 3.43k ) Number of downloads: 95
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bowlesj
post Apr 2 2018, 09:54 PM
Post #23


Novice
**

Group: Members
Posts: 22
Joined: 11-June 15
Member No.: 22,710



QUOTE(CharlesEF @ Apr 2 2018, 08:21 PM) *

Attached is a sample page with a modal popup (that's what I call it). In the zip file is the original combobox.html with a few slight changes. Open 'selects.html' in your browser and add an item to any of the selects.

Does your current web host provide mysql databases? Or maybe you have a different database.
Attached File  temp.zip ( 3.43k ) Number of downloads: 95



Thanks for the "adding to a combo box" example. Another variant on your idea in my table situation (which I never would have thought of without your help) would be to add anther column to the right of the combo box and if they can't find it in the list they could reset the combo box to unselected and tab over to the next column and fill it out. This way I would know it was new when they send the form down to my php code which creates the mailing. The way I am doing it now I would never know it was new.

I suspect my web host company has mysql. As I mentioned I am not bothering to ask to see if I could set it up. They support php so my guess is they do.

I went back to that jquery thing. I suspect it is just creating a protected layer which has 2 buttons on it and a checkbox. That is why the javascript code just keeps going (opening a layer won't stop the code). When any of these items in the special protected layer are clicked a function must be called to create an action. So in effect it is a layer that looks like a user prompt but is not a real user prompt. I came up with the idea of putting the exit function immediately after the function that creates the layer as a way to make it easier to understand. It is better than creating a special function in the middle of nowhere.

This post has been edited by bowlesj: Apr 2 2018, 09:59 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Apr 2 2018, 10:13 PM
Post #24


Programming Fanatic
********

Group: Members
Posts: 1,544
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



If you have the screen area available then adding another column like you say is a good idea. If you trust your user to only fill in the field when a item is not in the drop down. Or, you could hide that extra column and use a variant of my modal example to fill in that column only when a new item is added.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bowlesj
post Apr 2 2018, 11:01 PM
Post #25


Novice
**

Group: Members
Posts: 22
Joined: 11-June 15
Member No.: 22,710



QUOTE(CharlesEF @ Apr 2 2018, 11:13 PM) *

If you have the screen area available then adding another column like you say is a good idea. If you trust your user to only fill in the field when a item is not in the drop down. Or, you could hide that extra column and use a variant of my modal example to fill in that column only when a new item is added.

Yes I think your last idea is the best. I am a bit tight on space. I am assuming I could make it hidden and very narrow but it could still store a large song name.

By the way, I did some RPG programming when I was in school learning Assembler, Cobol and RPG II. They were just phasing it out at the job I landed after school. They were also phasing out Assembler. They stuck with Cobol for many years after that and moved to Microfocus Cobo when they shifted to unix. It was at that time I learned unix shell scripting (loved that set of languages). I picked up MS-Access VBA on my own. 4 years ago I decided to learn web programming and basically learned the little I know through google searches (learned just enough to complete my website with about 200 database driven pages). What some might call "just in time learning".

This post has been edited by bowlesj: Apr 2 2018, 11:03 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Apr 3 2018, 03:00 AM
Post #26


Programming Fanatic
********

Group: Members
Posts: 1,544
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(bowlesj @ Apr 2 2018, 11:01 PM) *
By the way, I did some RPG programming when I was in school learning Assembler, Cobol and RPG II. They were just phasing it out at the job I landed after school. They were also phasing out Assembler. They stuck with Cobol for many years after that and moved to Microfocus Cobo when they shifted to unix. It was at that time I learned unix shell scripting (loved that set of languages). I picked up MS-Access VBA on my own. 4 years ago I decided to learn web programming and basically learned the little I know through google searches (learned just enough to complete my website with about 200 database driven pages). What some might call "just in time learning".
Yes, I too learned Cobol and RPG II, among many others. While I was working on mainframes the VIC 20 came out. You would be surprised at what you could learn from the VIC 20 and Commodore 64. I too moved to Unix and shell scripting, it was wonderful.

Anyway, attached is a different version of the previous file. Place it in the same directory as 'selects.html'.
Attached File  table.html ( 8.35k ) Number of downloads: 101
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bowlesj
post Apr 3 2018, 04:54 AM
Post #27


Novice
**

Group: Members
Posts: 22
Joined: 11-June 15
Member No.: 22,710



Thanks for the new version of the previous file. I just checked it out. I like how you managed to get the column to hide. When I tried it the column's data just went away but the column stayed there. Time to study how you did that :-)

I had a Commodore 64. I wrote a tiny machine language loop on it just to check it out. It was a bit too low for me :-) I knew a guy who wrote games in machine language on a Commodore pet I think it was. I would think that would be very tedious.

This post has been edited by bowlesj: Apr 3 2018, 05:53 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bowlesj
post Apr 3 2018, 06:01 AM
Post #28


Novice
**

Group: Members
Posts: 22
Joined: 11-June 15
Member No.: 22,710



I tried the download of your table sample CharlesEF. For some reason reason it says it is downloading but I don't find it in my downloads directory.

Here is the jquery popup as a return gift. I don't understand exactly how the jquery part works but I persisted and managed to get command of creating these nice looking simulated layer popups. Putting the call back function immediately after the initial call that opens up the popup layer helps one get less confused when debugging/revisiting because they are right together (I wish I got that idea when I first started working with it). GlobalDeleteCookieProcedure is a variable that does exactly what it says. You give it a value if you want to include the popup telling the user how to bring the main popup back if they decide to check the box to not see it any more. I don't actually remember what the Mod_DialogPopupHelp php module does even though I put it together (one forgets a lot in 4 years). I included it because it appears to be part of the set.


I created a page for testing all the combinations and deleting the checkbox cookies. I attached the full page as well. It is the one called frmDialogAllButtons.php

CODE

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>




<!--this HTML code defines the actual text area for the confirm box. It is basically the layer.-->
<div id="dialog-confirm-checkbox">dialog init message</div>

<style>
/* This CSS code is to make your layer hidden when it first goes out */
#dialog-confirm-checkbox {  
    display:none
}
</style>

<script>
var GlobalCookieName = "Whatever"; //Defined so the checkbox function could get the cookie name
var GlobalDeleteCookieProcedure = ""; //You set this as null if you want no message given to the user on how to delete the cookie
var GlobalPopupResponse = "?";


//======================================================================== Function Pair
//START: Function Pair
function funcTestEnter(CookieName,ConfirmMessage) {
   if (checkCookie(CookieName) == "set") {
      funcAfterDialogProcess(CookieName);
      return true;
   }
   GlobalCookieName = CookieName; //Set so the checkbox function could get the name
   funcDialogConfirmCheckbox(CookieName,ConfirmMessage);
}
function funcTestExit() {
   if (GlobalPopupResponse == "Y") {
      //alert("They Entered Y");
      document.getElementById('Editbox_DialogTest').value = "Y";
   }
   if (GlobalPopupResponse == "N") {
      //alert("They Entered N");
      document.getElementById('Editbox_DialogTest').value = "N";
   }
}
//END: Function Pair

//======================================================================== Dialog Box
function funcDialogConfirmCheckbox(CookieName,ConfirmMessage) {
   document.getElementById('dialog-confirm-checkbox').innerHTML = ConfirmMessage; //Set the confirm dialog
    $("#dialog-confirm-checkbox").dialog({
        resizable: false,
        modal: true,
        title: "Please Confirm.",
        height: 250,
        width: 500,
        create: function (e, ui) {
            var pane = $(this).dialog("widget").find(".ui-dialog-buttonpane")
            $("<label class='ConfirmCheckboxClass' ><input id='ConfirmCheckbox' type='checkbox'/> Don't show this confirmation again?</label>").prependTo(pane)
        },
        buttons: {
            "Yes": function () {
               document.getElementById('ConfirmCheckbox').checked = false;
                GlobalPopupResponse = "Y";
               $(this).dialog('close');
               funcTestExit();
            },
            "No": function () {
               document.getElementById('ConfirmCheckbox').checked = false;
                GlobalPopupResponse = "N";
               $(this).dialog('close');
               funcTestExit();
            }
        }
    });
}

//======This function takes care of the checking and unchecking of the checkbox
$(document).on("change", ".ConfirmCheckboxClass input", function () {
   if (this.checked == true) {
      document.cookie = GlobalCookieName + "=" + 'Bypass; expires=Thu, 18 Dec 2099 12:00:00 UTC;'
      if (GlobalDeleteCookieProcedure == "") {
          //No Message to display
      } else {
         alert(GlobalDeleteCookieProcedure);  //This tells the user how to bring the pop-up back again
      }
   } else {
      deleteCookie(GlobalCookieName); //User could change their mind
      //alert("Confirmation is activate again");                
   } //End of the if statement
})

</script>



This post has been edited by bowlesj: Apr 3 2018, 07:00 AM


Attached File(s)
Attached File  Mod_DialogConfirm.php ( 1.13k ) Number of downloads: 59
Attached File  Mod_DialogConfirmCheckbox.php ( 2.62k ) Number of downloads: 67
Attached File  Mod_DialogCookieFunctions.php ( 710bytes ) Number of downloads: 67
Attached File  Mod_DialogPopup.php ( 801bytes ) Number of downloads: 60
Attached File  Mod_DialogPopupCheckbox.php ( 2.34k ) Number of downloads: 58
Attached File  Mod_DialogPopupHelp.php ( 796bytes ) Number of downloads: 62
Attached File  frmDialogAllButtons.php ( 9.37k ) Number of downloads: 61
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Apr 3 2018, 12:22 PM
Post #29


Programming Fanatic
********

Group: Members
Posts: 1,544
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



I've a full day ahead but I'll look over the files tonight. Let's try the download again. I zipped it up this time.
Attached File  temp1.zip ( 5.66k ) Number of downloads: 96
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
bowlesj
post Apr 3 2018, 05:22 PM
Post #30


Novice
**

Group: Members
Posts: 22
Joined: 11-June 15
Member No.: 22,710



The zip file came down this time.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

2 Pages V < 1 2
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 15th October 2018 - 08:24 PM