Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 68

Thread: [RESOLVED] How to get JavaScript to generate os variables for my HTML form?

  1. #31
    Join Date
    Dec 2008
    Hmm, I'm not sure. It seems like everything is working the way it's supposed to now, as far as my script, except that it's not.... I'm still looking. We'll figure it out, this is all part of testing.

  2. #32
    Join Date
    Dec 2008
    Change your form to method="POST" instead of method="post" and add enctype="multipart/form-data"

  3. #33
    Join Date
    Dec 2008
    still nothing, but at least I'm not getting the file upload error anymore.

  4. #34
    Join Date
    Nov 2009
    Change your form to method="POST" instead of method="post" and add enctype="multipart/form-data"
    Done that and Tested it. No joy so far but I like your enthusiasm

  5. #35
    Join Date
    Dec 2008


    Just until we figure out what's causing the problem, let's change the ValidateForm() to stop form submission so we can see all the HTML changes that occur.

    At the very bottom of ValidateForm(), you'll see a line that says "return true;". Let's change that to "return false;" temporarily. I'm talking about in the valid.js file.

    Use this file:
    Last edited by jamesbcox1980; 11-12-2009 at 01:09 PM.

  6. #36
    Join Date
    Dec 2008



    I was wondering what you mean earlier when you said
    By the way I removed the JavaScript code from the head and the one after the form which you suggested earlier.

    The new function is calling those functions, but I guess you thought we were replacing them. That's not the case. We need to add them back in!

    I stepped through the JS using Firebug, cause I guess you're headed home, and I discovered that it was calling a function that wasn't there.

    So, disregard our last version, and use this one. (I just went ahead and added them to the valid.js)

  7. #37
    Join Date
    Nov 2009
    I'm home now and transferred over the new js file you sent over. I noticed on that file the "return is true" on the last line. Do you want me to change it to "return false"?

  8. #38
    Join Date
    Dec 2008


    No, that fixed the problem, but fixing that shows there's one last (hopefully) problem to deal with. Since we're not adding them manually, there are no pre-existing inputs to look at, so we need to adjust the PPopSort array to handle that.

    Hopefully, one last upload:
    Last edited by jamesbcox1980; 11-12-2009 at 01:34 PM.

  9. #39
    Join Date
    Nov 2009
    Just Googled PPopSort array and guess what came up? Our thread in webdeveloper.com came up lol.

    Ok I'm watching part 2 of 4 of the videos...difficult when you have kids running around.

    Well keep trying my friend, I'm sure we'll get there. I just added firebug and will play with it and learn a bit more. Again thanks to you.

  10. #40
    Join Date
    Dec 2008
    check my post again, I just edited and add the new file (where I said "Hopefully, one last upload"). It was actually the same problem we had the first time around, and I added the ternary operator... I used the original script :P
    Last edited by jamesbcox1980; 11-12-2009 at 01:40 PM.

  11. #41
    Join Date
    Nov 2009
    I uploaded the valid.js script from the (hopefully) post. I checked it and now that "Add object or person" keeps showing up. What can I do to get rid of this?

  12. #42
    Join Date
    Nov 2009
    Hi James

    I emailed a few other developers and one of them got back to me and suggested the following:

    You might try something like this in HTML:
    <input id=”on0” type="hidden" name="on0" value="Photo manipulation">
    <input id=”os0” type="hidden" name="os0" value="Whatever addons the customer selects">
    With this corresponding javascript:
    var on0 = document.getElementById('on0');
    on0.setAttribute("on0", "My Desired value”);

    Can this help?


  13. #43
    Join Date
    Dec 2008
    No, that's essentially what I was doing with the script. The script is fine now and is working. The problem is it's not getting run because of some other error on the page.

    When I finish filling out the form, and I run ValidateForm() using the FireBug watch script, it adds the options perfectly.

  14. #44
    Join Date
    Nov 2009


    I actually found out something interesting by looking at it. Remember I kept asking you about the HTML page? Look at the code below:

    Before the HTML page had these lines:

      <INPUT type="hidden" name="item_name" value="Add object or person">
      <INPUT type="hidden" name="amount" id="amount" value="9.99">

    I changed the name from the first line & got rid of the value of the 2nd line:

      <INPUT type="hidden" name="item_name" value="Retouching Photos">
      <INPUT type="hidden" name="amount" id="amount" value="">
    Now when I run the form and go to the PayPal page, the good news is: It shows:

    Retouching Photos
    then it shows the first Add-on I select.

    So you (the man!) have solved the original problem (where nothing used to show up in the PayPal page) but now faced with a new problem which is:

    No matter how many Add-ons I select, the JavaScript only shows the first Add-on on the PayPal page.

    If firebug is showing that the script runs perfectly, then what is causing it not to run on the form page and then the PayPal page?

    I guess you knew all this before and I just figured it out. I'm slow... like a tortoise heh heh.

    Over 400 smart people read this thread!
    James we should open a *witter account for this problem. Atleast we'd have a large number of followers lol.

    Anyone out there know what the problem is on this Form or the JavaScript?

    I am offering to retouch your photo for free.

  15. #45
    Join Date
    Dec 2008
    Yeah, it's only adding one add-on. I just realized that the checkboxes at the bottom may be causing the problem. When writing this, I wasn't even thinking of them. I'm working on it. I should be able to get this working fully using firebug before I get back to you

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.13786 seconds
  • Memory Usage 3,013KB
  • Queries Executed 15 (?)
More Information
Template Usage (37):
  • (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
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)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 (75):
  • 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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit
  • 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