Skip to content
WJunction - Webmaster Forum

Text Box to Radio Box's

Status
Not open for further replies.
Hello, recently I have decided to let members change there username colour around the forums with the vB-Shop feature that allows this. Well while I have been doing so, I do not want to allow the usual text box because people can use any hashed username colours or use the colour "transparent" so they have no username! So I decided I wanted it to look like this:

833z.png


But now when I click the box and click save it does not save.

Here is the original text box code were you can type your own colour into it:

Code:
<td class="alt2"><input type="text" name="code[color]" class="bginput" size="35" /></td>

And here is the one I changed it to:

Code:
<td class="alt2"><form>
<input type="radio" name="code[color]" /> Red<br />
<input type="radio" name="code[color]" /> Blue<br />
<input type="radio" name="code[color]" value="green" /> Green<br />
</form></td>

Can someone please help me getting this working.

Thanks.

Also if someone is willing to come and do this for a small amount of money then I'm happy to pay.
 

2 comments

How did the colours where inputted by the user before in the textbox? By Colour Codes? :s

You can then specify colour code as value! Though the value could be easily changed if the request data is posted differently! You also needed to check if the color matchs in allowed color list to prevent this
 
You have not defined each colour code. You need a unique id for each colour that you allow to be selected.

Try this, no guarantees it will work.

Code:
<td class="alt2"><form> 
<input type="radio" name="code[red]" /> Red<br /> 
<input type="radio" name="code[blue]" /> Blue<br /> 
<input type="radio" name="code[green]" value="green" /> Green<br /> </form></td>
 
Status
Not open for further replies.

About the author

MrOSX
Active Member · Joined
1,070
Messages
414
Reactions
83
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom