HTML / PHP Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • longsack
    Confirmed User
    • Aug 2005
    • 32

    #1

    HTML / PHP Help

    I have a form here is the nuts off it.

    <tr><td>Date:</td><td><input type="text" name="date" size="8" value="{date}"> [<a href="javascript:void(0)" onclick="document.f1.date.value='{now}'">set to now</a>]</td></tr>
    <tr><td>Category:</td><td><select name="category">{category_choices}</select></td></tr>
    <tr><td>SubCategory:</td><td><select name="subcategory[]" multiple="multiple" size="25" style="height: 100%;">{subcategory_choices}</select></td></tr>
    <tr><td>Filename:</td><td><input type="text" name="filename" size="40" value="{filename}"></td></tr>
    <tr><td>Title:</td><td><input type="text" name="title" size="40" value="{title}"></td></tr>
    <tr><td>Description:</td><td><textarea name="description" cols="60" rows="4">{description}</textarea></td></tr>
    <tr><td>Keywords:</td><td><input type="text" name="keywords" size="40" value="{keywords}"></td></tr>
    <tr><td>Model:</td><td><input type="text" name="custom1" size="40" value="{custom1}"></td></tr>
    <tr><td>Paysite:</td><td><input type="text" name="custom2" size="40" value="{custom2}"></td></tr>



    PHP is pulling some of the data from MySQL... I want to make it so that I can enter text AND / OR pre-select some keywords that I build.... in the following inputs
    Title, Keywords, Model and, Paysite


    For example I would go into the form and "Paysite" would have a drop down with Site1, Site2, Site3 and Site4....
    or
    Keywords I could input text or have a dropdown with pre-defined keyword sets "key1, key2, key3 ...", but I could also take away or add if needed via text....

    is it possible?
    I'm pulling all this from Video Manager, by wojfun (I cannot post URLs)... for CCBill (this is the script I'm using trying to modify). Any thoughts, thanks in advance!!!!
  • InfoGuy
    80/20 Rule
    • Apr 2010
    • 3052

    #2
    <table>, <tr> and <td> tags are all deprecated. I would suggest using a different form.
    Support American Heroes | How Bad is My Batch? | Vaccine Deaths & Adverse Reactions | Free Speech Coalition | <WARNING> ePayService / Guerra Capital, INC / MTACC payments | Flirt4Free Fucks their Affiliates | Don't do business with piece of shit Andy Alvarez from Webmaster Central / VR3000, who said:
    "If it was up to me, they would have shot all 30,000 of those country loving shitheads"

    Comment

    • the indigo
      Confirmed User
      • Sep 2001
      • 2016

      #3
      "There he goes. One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die." -Hunter S. Thompson

      Comment

      • bean-aid
        So Fucking Banned
        • Jun 2011
        • 16493

        #4
        I would one off it

        Comment

        • ZTT
          Confirmed User
          • Apr 2019
          • 659

          #5
          As usual I'm not sure what's being asking for, but do you mean autocomplete, like this?

          https://codepen.io/adaptabiz/pen/WNoRjVd
          __________________

          Comment

          • k33n
            Confirmed User
            • Feb 2009
            • 201

            #6
            Just my , use <form>

            Comment

            • Publisher Bucks
              Confirmed User
              • Oct 2018
              • 1330

              #7
              Is this what you are looking for?

              <tr><td>Date:</td><td><input type="text" name="date" size="8" value="{date}"> [<a href="javascript:void(0)" onclick="document.f1.date.value='{now}'">set to now</a>]</td></tr>
              <tr><td>Category:</td><td><select name="category">{category_choices}</select></td></tr>
              <tr><td>SubCategory:</td><td><select name="subcategory[]" multiple="multiple" size="25" style="height: 100%;">{subcategory_choices}</select></td></tr>
              <tr><td>Filename:</td><td><input type="text" name="filename" size="40" value="{filename}"></td></tr>
              <tr><td>Title:</td><td><input type="text" name="title" size="40" value="{title}"></td></tr>
              <tr><td>Description:</td><td><textarea name="description" cols="60" rows="4">{description}</textarea></td></tr>
              <tr><td>Keywords:</td><td><input type="text" name="keywords" size="40" value="{keywords}"></td></tr>
              <tr><td>Model:</td><td><input type="text" name="custom1" size="40" value="{custom1}"></td></tr>
              <tr><td>Paysite:</td><td></td></tr><form method="post">
              <select name="Select1">
              <option>Paysite 1</option>
              <option>Paysite 2</option>
              <option>Paysite 3</option>
              </select></form>

              Extreme Link List - v1.0

              Comment

              • hornyasf
                Confirmed User
                • Jul 2021
                • 185

                #8
                Originally posted by InfoGuy
                <table>, <tr> and <td> tags are all deprecated. I would suggest using a different form.
                Yup. That code looks like a god damn mess.

                Comment

                • sarettah
                  see you later, I'm gone
                  • Oct 2002
                  • 14293

                  #9
                  I usually accomplish what you are describing by using a select (dropdown list) and a text field next to each other so that the user can pick from the dropdown or enter a new value.

                  I think that is what you are describing.

                  Something like this:

                  <b>Select Name:</b>
                  <select name="name_select">
                  <option></option>
                  <option>name1</option>
                  <option>name2</option>
                  </select> - OR -
                  <b>Enter name:</b><input type=text name=name2use id=name2use value="" size=50 maxlength=254>

                  I also use some javascript tricks so that if they do the select then the text field is disabled and vice versa.

                  .
                  All cookies cleared!

                  Comment

                  • sarettah
                    see you later, I'm gone
                    • Oct 2002
                    • 14293

                    #10
                    Originally posted by InfoGuy
                    <table>, <tr> and <td> tags are all deprecated. I would suggest using a different form.
                    No, they aren't.

                    Check the html spec if you don't believe me. They should not be used for layout but they are still perfectly valid html and should be used for data tables.


                    Html 4.01 spec https://www.w3.org/TR/html401/struct/tables.html

                    Html 5 spec https://dev.w3.org/html5/spec-LC/tab...-table-element

                    .
                    All cookies cleared!

                    Comment

                    • Colmike9
                      (>^_^)b
                      • Dec 2011
                      • 7230

                      #11
                      Originally posted by sarettah
                      No, they aren't.

                      Check the html spec if you don't believe me. They should not be used for layout but they are still perfectly valid html and should be used for data tables.


                      Html 4.01 spec https://www.w3.org/TR/html401/struct/tables.html

                      Html 5 spec https://dev.w3.org/html5/spec-LC/tab...-table-element

                      .
                      Yep. It's not depreciated and more "just use that for tabulated data and other places where it's supposed to be used".
                      I might be wrong, but even though table isn't depreciated, aren't a lot of the table attributes depreciated?
                      Tables aren't the best for performance, though.
                      Join the BEST cam affiliate program on the internet!
                      I've referred over $1.7mil in spending this past year, you should join in.
                      I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years..

                      Comment

                      • longsack
                        Confirmed User
                        • Aug 2005
                        • 32

                        #12
                        I know the code looks like a mess, and it's dated. I just don't really want to go through the trouble of rebuilding from the ground up, if I don't have to.

                        I'm going to try a couple of the suggestions.... Yes like auto-complete, I think that is what I will attempt to go for on this, it would just make what I'm doing a hell of a lot less work...

                        Comment

                        • longsack
                          Confirmed User
                          • Aug 2005
                          • 32

                          #13
                          Originally posted by sarettah
                          I usually accomplish what you are describing by using a select (dropdown list) and a text field next to each other so that the user can pick from the dropdown or enter a new value.

                          I think that is what you are describing.

                          Something like this:

                          <b>Select Name:</b>
                          <select name="name_select">
                          <option></option>
                          <option>name1</option>
                          <option>name2</option>
                          </select> - OR -
                          <b>Enter name:</b><input type=text name=name2use id=name2use value="" size=50 maxlength=254>

                          I also use some javascript tricks so that if they do the select then the text field is disabled and vice versa.

                          .

                          This is a nice find.

                          Comment

                          • sarettah
                            see you later, I'm gone
                            • Oct 2002
                            • 14293

                            #14
                            If what you are looking for is the autocomplete type thing then you are probably wanting a combo box.

                            The simplest form of that is probably the html5 list attribute:

                            https://www.w3schools.com/tags/tryit...html5_datalist

                            But there are also some jquery options:

                            https://jqueryui.com/autocomplete/

                            https://www.telerik.com/blogs/how-to...n-your-web-app

                            I am not sure that there are any ready made controls that will let you add an item by typing it into the combobox, most just do the sutocomplete type thing allowing you to search the list by typing something in and finding it in the list.

                            I would think that someone had to come up with one at some poiint though because it really wouldn't be that difficult to figure out (famous last words).

                            .
                            All cookies cleared!

                            Comment

                            • sarettah
                              see you later, I'm gone
                              • Oct 2002
                              • 14293

                              #15
                              I was just messing with the html5 list code and it does what I think you want.

                              You can start typing and if it matches something, that something will show up on the list. If it does not match anything you can continue typing and when you hit the submit whatever you typed gets passed in as input.

                              No java script tricks needed.

                              .
                              All cookies cleared!

                              Comment

                              Working...