Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Datalist input type added #46

Closed

Conversation

david4worx
Copy link
Contributor

Added type to the input field so it can be controlled from the elementas to what kind of datalist should be rendered

…nt as to what kind of datalist should be rendered
@seaneble
Copy link

seaneble commented Feb 7, 2013

Thanks for this interesting code. But unfortunately I cannot quite agree this is the final solution.
What I definitely miss are the id and name attributs for the <input> tag. I think it would be good to move them from the <datalist> to the field itself and name the datalist with a suffix (like _data) or something.

@seaneble
Copy link

seaneble commented Feb 7, 2013

Actually, at the moment it would also not be possible to set the following attributes:

  • value
  • min
  • max
  • step

I think, it might be better to change the other form fields towards supporting datalists instead of adding all the necessary options to the Datalist form element.

@david4worx
Copy link
Contributor Author

Ahh I misunderstood part of the question then.
But considering that, wouldn't you need the input type=range field? That field does exactly that as you requested.

@seaneble
Copy link

seaneble commented Feb 7, 2013

I need to create the following code with Zend_Form :-)

<input id="duration" name="duration" type="range" value="60" min="1" max="2400" list="duration_list" />
<output name="duration_value">60</output>
<datalist id="duration_list">
    <option value="10" label="ten minutes">ten minutes</option>
    <option value="30" label="half an hour">half an hour</option>
    <option value="60" label="one hour">one hour</option>
    <option value="120" label="two hours">two hours</option>
    <option value="240" label="half a day">half a day</option>
    <option value="480" label="one day">one day</option>
    <option value="960" label="two days">two days</option>
</datalist>

As this is the only good library I could find that adds HTML5 support to Zend, I'd like to get this to work. Do you think it is of general interest to generate code like above or should I build something in my own library?

@david4worx
Copy link
Contributor Author

Sorry for the long delay.

I've haven't had the time to dev something together like what you want. But I'll put it on my todo list.
You could always try your skills and build something yourself and make a pull request when it's ready.

@david4worx david4worx closed this Feb 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants