www.webdeveloper.com
Results 1 to 2 of 2

Thread: I can't figure out what's wrong with this code

  1. #1
    Join Date
    Feb 2007
    Posts
    9

    Question I can't figure out what's wrong with this code

    I made a code for a little prize drawing on my web site, but The "Get a QP" button isn't working. If anyone can help me with this code, I'd really appreciate it.


    <HTML>
    <HEAD>

    <TITLE>Get a Code</TITLE>
    //--!This is to get the code
    <SCRIPT language="JavaScript">
    <!--
    function get_random()
    {
    var ranNum= Math.floor(Math.random()*100);
    return ranNum;
    }

    function getaQP()
    {
    var getQP=get_random();

    var quote=new Array(100)
    quote[0]='9, 26, 18, 56, 23';
    quote[1]='36, 41, 8, 16, 20';
    quote[2]='21, 11, 62, 28, 56';
    quote[3]='8, 53, 36, 55, 56';
    quote[4]='37, 21, 33, 16, 64';
    quote[01]='52, 12, 37, 41, 39';
    quote[11]='13, 29, 60, 52, 19';
    quote[21]='5, 69, 4, 42, 2';
    quote[31]='41, 42, 57, 20, 21';
    quote[41]='67, 28, 36, 61, 35';
    quote[02]='8, 35, 26, 29, 23';
    quote[12]='25, 15, 20, 8, 65';
    quote[22]='9, 12, 10, 32, 28';
    quote[32]='19, 30, 13, 11, 15';
    quote[42]='22, 18, 57, 13, 46';
    quote[03]='24, 52, 17, 10, 29';
    quote[13]='31, 14, 10, 54, 7';
    quote[23]='34, 30, 37, 63, 68';
    quote[33]='15, 15, 63, 38, 53';
    quote[43]='55, 24, 20, 40, 7';
    quote[04]='26, 57, 35, 31, 46';
    quote[14]='2, 33, 22, 32, 37';
    quote[24]='41, 14, 38, 19, 33';
    quote[34]='53, 53, 18, 49, 21';
    quote[44]='50, 32, 54, 27, 61';
    quote[05]='48, 39, 63, 29, 60';
    quote[15]='11, 8, 33, 22, 51';
    quote[25]='49, 23, 20, 45, 18';
    quote[35]='61, 64, 45, 68, 12';
    quote[45]='19, 63, 33, 2, 52';
    quote[06]='9, 26, 16, 15, 1';
    quote[16]='7, 28, 11, 62, 51';
    quote[26]='26, 36, 24, 37, 26';
    quote[36]='69, 7, 69, 52, 60';
    quote[46]='13, 44, 65, 7, 4';
    quote[07]='65, 29, 17, 58, 16';
    quote[17]='29, 67, 29, 37, 36';
    quote[27]='32, 38, 46, 6, 39';
    quote[37]='56, 42, 20, 48, 24';
    quote[47]='23, 19, 16, 24, 2';
    quote[08]='15, 49, 60, 26, 9';
    quote[18]='60, 66, 63, 38, 8';
    quote[28]='20, 58, 59, 54, 3';
    quote[38]='25, 63, 63, 44, 39';
    quote[48]='47, 9, 24, 8, 19';
    quote[09]='47, 58, 66, 43, 14';
    quote[19]='64, 29, 69, 60, 12';
    quote[29]='66, 59, 66, 34, 33';
    quote[39]='36, 38, 24, 46, 19';
    quote[49]='69, 24, 58, 19, 44';
    quote[011]='63, 44, 4, 62, 46';
    quote[111]='21, 27, 64, 40, 63';
    quote[211]='60, 9, 13, 51, 65';
    quote[311]='39, 23, 60, 59, 58';
    quote[411]='6, 51, 55, 9, 54';
    quote[022]='40, 25, 32, 2, 50';
    quote[122]='41, 44, 34, 44, 1';
    quote[222]='26, 64, 37, 10, 2';
    quote[322]='33, 50, 9, 36, 10';
    quote[422]='13, 24, 37, 67, 64';
    quote[033]='35, 4, 68, 20, 58';
    quote[133]='27, 65, 61, 34, 18';
    quote[233]='21, 5, 38, 23, 60';
    quote[333]='44, 16, 19, 56, 39';
    quote[433]='26, 34, 36, 43, 20';
    quote[044]='38, 4, 59, 57, 67';
    quote[144]='38, 46, 39, 46, 13';
    quote[244]='16, 49, 41, 8, 45';
    quote[344]='7, 37, 64, 42, 53';
    quote[444]='48, 14, 51, 33, 3';
    quote[055]='22, 15, 59, 49, 58';
    quote[155]='21, 6, 43, 35, 7';
    quote[255]='30, 44, 64, 6, 63';
    quote[355]='32, 16, 1, 38, 23';
    quote[455]='68, 21, 36, 49, 32';
    quote[066]='56, 64, 69, 33, 4';
    quote[166]='14, 65, 8, 49, 35';
    quote[266]='35, 45, 18, 36, 16';
    quote[366]='17, 11, 63, 50, 62';
    quote[466]='64, 35, 15, 56, 63';
    quote[077]='30, 34, 28, 38, 20';
    quote[177]='37, 20, 42, 55, 59';
    quote[277]='19, 58, 26, 15, 12';
    quote[377]='50, 24, 62, 13, 28';
    quote[477]='1, 49, 12, 14, 4';
    quote[088]='57, 15, 63, 45, 65';
    quote[188]='49, 28, 67, 17, 52';
    quote[288]='24, 10, 11, 11, 58';
    quote[388]='11, 62, 56, 64, 19';
    quote[488]='43, 30, 26, 28, 35';
    quote[099]='26, 11, 61, 3, 22';
    quote[199]='41, 63, 64, 32, 48';
    quote[299]='51, 49, 38, 56, 9';
    quote[399]='36, 56, 7, 13, 54';
    quote[499]='66, 64, 22, 12, 6';
    quote[000]='67, 40, 28, 38, 43';
    quote[100]='4, 22, 50, 60, 46';
    quote[200]='4, 22, 50, 60, 46';
    quote[300]='30, 68, 67, 67, 58';
    quote[400]='3, 61, 12, 24, 3';

    alert(quote[whichQuote]);
    }
    //-->
    </SCRIPT>

    //--! and of course this is the end of the code

    </HEAD>


    //--! Ignore this
    <BODY>
    <H2>This is a random 5 number pick (if you click the button) that may be picked more than once. Write it down and type it into the following textbox.</H2>
    <br>
    <H2>If you would like, you can make up your own 5 number pick in the form 1, 2, 3, 4, 5 (must be in that exact way). Just type it into the box.</H2>
    <br>

    //--!isn't working
    <FORM name="form1">
    <INPUT TYPE="button" value="Get a QP" onClick="getanumber()">
    </FORM>
    //--! rest works

    <FORM METHOD=POST ACTION="mailto:info@greatbuysweb.com" ENCTYPE="text/plain">
    <p>E-mail<INPUT TYPE="text" NAME="E-mail" SIZE=18>
    <p>Number<INPUT TYPE="text" NAME="Number" SIZE=18>
    <BR>
    <INPUT TYPE="submit" VALUE="Submit">
    <INPUT TYPE="reset" VALUE="Clear">


    </FORM>
    </BODY>
    Last edited by imagenius; 02-14-2007 at 02:57 PM.

  2. #2
    Join Date
    Jan 2007
    Location
    .qc.ca
    Posts
    43
    Hi imagenius,

    My first idea would be to have different names for your function getanumber() and the variable getanumber...
    - AgrestiK.com -

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.14693 seconds
  • Memory Usage 2,844KB
  • Queries Executed 13 (?)
More Information
Template Usage (32):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (2)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates