Jump to content

Function


unidox

Recommended Posts

I was wondering how I can do this:

 

I have alot of options inside a select, and I need to have the values like:

 

<option <? if($r['name'] == option value) { echo "selected = selected"; } ?> value = "John">

 

but the problem is, how can I find the value without typing the name in for each option. Thanks

Link to comment
https://forums.phpfreaks.com/topic/118270-function/
Share on other sites

Ok, I have a dropdown like this:

 

<select name="name">

  <option value="John">

</select>

 

but I have over 400 options from the drop down. I was wondering if there was a way I can make it selected if the user already selected it. Because lets say I add a user, it adds the name John in the db. When I want to edit the user, I dont want to sort through all the names, I am trying to have it selected if the value matches the database.

 

How can I do that? Thanks

Link to comment
https://forums.phpfreaks.com/topic/118270-function/#findComment-608622
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.