GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   HTML / PHP Help (https://gfy.com/showthread.php?t=1348425)

longsack 09-17-2021 06:33 PM

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 09-18-2021 08:12 AM

<table>, <tr> and <td> tags are all deprecated. I would suggest using a different form.

the indigo 09-18-2021 09:08 AM

https://i.imgur.com/S4q2H0V.gif

bean-aid 09-18-2021 09:50 AM

I would one off it

ZTT 09-18-2021 09:55 AM

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

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

k33n 09-18-2021 09:57 AM

Just my :2 cents:, use <form>

Publisher Bucks 09-18-2021 10:06 AM

Is this what you are looking for?

Quote:

<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>



hornyasf 09-18-2021 10:09 AM

Quote:

Originally Posted by InfoGuy (Post 22915025)
<table>, <tr> and <td> tags are all deprecated. I would suggest using a different form.

Yup. That code looks like a god damn mess.

sarettah 09-18-2021 12:07 PM

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.

.

sarettah 09-18-2021 12:16 PM

Quote:

Originally Posted by InfoGuy (Post 22915025)
<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

.

Colmike9 09-18-2021 12:39 PM

Quote:

Originally Posted by sarettah (Post 22915068)
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.

longsack 09-18-2021 04:57 PM

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...

longsack 09-18-2021 04:58 PM

Quote:

Originally Posted by sarettah (Post 22915067)
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.

sarettah 09-18-2021 08:50 PM

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).

.

sarettah 09-18-2021 09:30 PM

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 times are GMT -7. The time now is 05:19 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc