vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   changing a select box value with js (https://vborg.vbsupport.ru/showthread.php?t=79262)

Carnage 04-03-2005 10:52 AM

changing a select box value with js
 
ok what i've got is a page with an image on it, it has an impage map and clickable areas on it, what i'm wanting is for whenever an area is clicked it to change the value of a select box to something else.

i tried: onmousedown='document.forms[6].selectbox.value=newvalue

it came up with the error: forms[6] has no properties

i also tried using the forms name in place of forms[6] same error... any ideas as to what this error means and how to fix it?

Colin F 04-03-2005 11:18 AM

Selectbox isn't clear to me. Do you mean a dropdown box?

Or a radio button?

Or checkboxes?

if you have a checkbox, then make it selectbox.checked = newvalue; and not value.


If you happen to know german, Selfhtml has a good reference for javascript (http://de.selfhtml.org/javascript/objekte/elements.htm)

Carnage 04-03-2005 11:43 AM

drop down box. ie <select><option> etc

Guy G 04-03-2005 12:59 PM

Shouldnt be approachable with the name of the form and check box?

Dean C 04-03-2005 01:13 PM

AFAIK you can't have trigger events on <option> tags, you need to apply the javascript event to the select :)

Carnage 04-03-2005 02:58 PM

i know that, i'm trying to attatch it to the image map, to change the option selected in the select box; which should be possible by changing its value...


All times are GMT. The time now is 11:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04805 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete