Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 27 May 2017, 15:39
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Each From with Select Option

field298 Single Line Text Box

Instead of free input I wanted to show a select dropdown to validate input. There were a ton of options, so I created an array, and then looped through the array to create the <options>. A first blank option was also added.

Template

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

HTML Output (small sampling)

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So this all works, and saves fine. The problem is that the selected attribute isn't catching on the option/field after it's been saved and then the form is brought up again. So the next time the form pulls up, it's blank, and then clears the field. Here's where I'm trying to set the attribute. What am I missing?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #2  
Old 27 May 2017, 15:48
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
You can't use vBulletin template syntax inside of a condition. Now it checks if it literally equals the string '{vb:raw userinfo.title}'. Changing it to the following should work, given that the $userinfo array variable is available.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #3  
Old 27 May 2017, 15:54
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Ugh, I knew that. Got too dialed in on the array and using options withe a text input to remember the basics.

Thanks so much

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 16:25.

Layout Options | Width: Wide Color: