Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Special select field creation
Old 04-05-2005, 04:04 AM Special select field creation
Novice Talker

Posts: 8
Trades: 0
Hello,

In a PHP script, I would like to create a field as a select field with possibility to write an other value. So, the application should propose some values, but the user could write other value if needed.
My problem is that it's not possible to write something in a normal select field. So, I think that it could be possible to do that with Javascript but I don't know Javascript.
Have you a solution ?

Tanks in advance
jn35 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-05-2005, 04:28 AM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
Hello jn35, welcome to webmaster-talk!

Do you have a hotmail account? If so, go along to the "Contacts" tab, then select New > Group (on the top bar). The page you then have should have two what looks like select boxes, that has a jazzy little mouse over and click effect. Not only this, but you can pass values back and forward between these boxes. You can also add values to the boxes using the textbox at the bottom of the form.

These are not actually select boxes, but simply a table! Using JavaScript we can pass the values between them.

Is this what you had in mind? As I was slightly confused by your post as to what exactly you meant. If it is, then I already have the solution for you, because I replicated it for my own uses a while ago!
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 04-05-2005, 05:13 AM
Novice Talker

Posts: 8
Trades: 0
Hello,

Many thanks for your answer.
Sorry, I don't have an hotmail account. Do you have an other example ?
In fact, I would like to allow users to easily fill a form with values already recorded in the table, but with the possibility to add other values.
MSAccess do this automatically with the list type field : a list is proposed, but you can type an other value.
Of course, I could do this by using 2 fields (one text field and one select field), but it's not usefull .
jn35 is offline
Reply With Quote
View Public Profile
 
Old 04-05-2005, 05:24 AM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
ok dude, i will show you what i mean later on today. I'll put the example of what i was trying to show you up, im pretty sure it's exactly what you need! till later.
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 05:08 AM
Novice Talker

Posts: 8
Trades: 0
Hello " leavethisplace"

I thank you in advance for your help I wait for impatiently ...
I forgot to add an important info : the list of proposed values can be long, so it's necessary to have a scroll button or some thing else ...
jn35 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 07:43 AM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
Sorry jn35! Almost completely forgot, but i've managed to put it online for you to view what i think you mean. Check this out, it's taken from the back-end of another site which needed to deal with email groups, so i ripped it from hotmail since i knew all the users of my site all had hotmail accounts and were familiar with the layout.

Anyway, I just want to know is this the sort of thing you had in mind? If it it, then i will write a long-*** tutorial on how you can achieve exactly the same thing - as it is pretty complex to look at.

Oh yeah, i know you wanted people to be able to add value that werent there (by having another text box there we can do this) but I will add this feature if i write the tutorial for you.

So, this what you wanted?
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 08:22 AM
Novice Talker

Posts: 8
Trades: 0
Many thanks !
Your idea is good, but it's not really what I mean. Do you have possibility to use MSAccess ?
If yes, you'll find joined a very short example that show what I would like to do.
If you can't, I'll try to explain it better ...
jn35 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 08:24 AM
Novice Talker

Posts: 8
Trades: 0
Sorry, I failled to attach the file. (I forgot to zip it) ...
Attached Files
File Type: zip Special list field sample.zip (12.5 KB, 3 views)
jn35 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 09:09 AM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
Windows has a 'combo box' widget that does this, but I'm not sure if there is a web form control that does the same...
You might have to settle for a static list box, and a text field to add extras.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 04-06-2005, 09:23 AM
Novice Talker

Posts: 8
Trades: 0
Thanks Oberon !
Yes, I know I can use a workaround by puting 2 fields in the form, but it's not elegant !
I think it's possible to do that with Javascript, but I don't know Javascript ...
jn35 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 09:28 AM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
could i not variate my design that i showed you somehow? I think it looks more elegant than a normal select box...
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 09:58 AM
Novice Talker

Posts: 8
Trades: 0
I'm agry with you : your solution is elegant, but it takes a lot of place. I would like to insert this special select field in a complex form, with a lot of other fields ...
But I think will try put two fields (one text and one select field) with a short explain (otherwise, that can be confuse for novice computer/internet user ...).
jn35 is offline
Reply With Quote
View Public Profile
 
Old 04-06-2005, 11:02 AM
Novice Talker

Posts: 8
Trades: 0
Finally, I found a solution (not the best, but not ambiguous for the users) : the selected value go automatically in the text field and is reseted. So the user has not a problem to know what is the good field : only the text one will have a value.

You can test the following :


<form action="post" name="form_name">

<script language="javascript" type="text/javascript">
function update_me(objet_select){

document.form_name.ch1.value = objet_select.value;
objet_select.selectedIndex = 0;

}
</script>

<input type="text" name="ch1" />
<select name="ch2" onChange="update_me(this)">
<option></option>
<option value="valeur">valeur</option>
</select>

</form>


That could be improved if I find a way to reduce the size of the select field WITHOUT reduce the list width when the user click on the field (we can see this some times in menus : the list proposed is often larger than the button in the menu). But I suppose that it's not possible to do this with a Select field ?
jn35 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Special select field creation
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.52432 seconds with 13 queries