Results 1 to 4 of 4

Thread: Welcome popup/JavaScript

  1. #1
    Join Date
    Jul 2011
    Lost in space

    Talking Welcome popup/JavaScript

    Hello guys!
    I would really like some information, if you can tolerate a total newbie, that is . I'm trying to make a website. I've got plenty of HTML, CSS and XHTML under my belt (check out my first website here). I usually use a DOCTYPE of transitional HTML 4.01. I'm starting off with JavaScript, and I'd like to make a little welcome script on my new site's main page. Here's what I'd like it to do:
    When the page loads, I'd like for there to be a popup prompt box saying, "Welcome! Please enter your first name:" and with a small text box in it. When the user types in his/her name and hits OK (or hits Cancel instead) the script would insert the name into the first sentence of the first paragraph (I use a drop cap, by the way), like this: It would change from something like "Hello! Welcome to my site!" to something like, "Hello {name}! Welcome to my site!". And when the person came back to the home page, the script would not pop up the box again but would continue to show his/her name until the browsing window/tab were closed, in which case the person would need to re-enter the name.
    I'm sorry if I wasn't very clear here on this. I have a couple scripts on the page that won't work with the DOCTYPE tag, so I can't use it. I know that's bad practice lol, but hey, it's transitional HTML, so I'm cool there. I tried this script from W3 Schools, but it replaces everything on the page...and won't work at all on my page. Of course, though, I did omit the button, so that might be it. I want the popup to pop up when the page loads, not when it's activated by a user, so...
    Can you guys clarify a bit please?
    Thank you ever so much,

  2. #2
    Join Date
    Jul 2011
    Lost in space
    Oop, forgot the links. Happens to me when I cut and paste XD
    The link to my first web site is http://babybear.us/ and the link to the script is http://www.w3schools.com/js/tryit.as...e=tryjs_prompt

  3. #3
    Join Date
    Jul 2011
    Lost in space
    Sorry for the repeat posts, maybe a mod can merge them please?
    I also forgot to say that that script doesn't remember the name like I wanted it to, or forget it when you close the window. It writes the first sentence not till after you close the prompt, and it empties the page as well. In short, it's not what I want, but I couldn't modify it...
    BTW, is there any way to make links that glow on mouseover work on Firefox? I use both Firefox and IE....

  4. #4
    Join Date
    Jul 2011
    Lost in space
    Ahhhh, sorry yet again. I'm so annoying, I know, but please bear with me here:
    There's another script I want to use on my "contact us" page, but why won't the form work if I try to get it to both send the form results to my email AND redirect me to the homepage? (I used my other site's address in lieu of my current project's home page for this try.) The basic code I'm using is as follows:

    <script type="text/javascript">
    function confirmInput()
    alert("Hello, " + fname + "! You will now be redirected to the Monkeypuzzle Manor Home Page.");
    <form method="post" action="mailto:(myemail); http://babybear.us/" enctype="text/plain" onsubmit="confirmInput()">
    <table style="border: 0px">
    <td>Name: </td><td><input id="fname" name="fname" type="text" size="20"></td></tr>
    <td>E-mail: </td><td><input type="text" name="email" size="30"></td></tr>
    <td>Question Type: </td><td><select name="questiontype" size="1"> <option>General question about Monkeypuzzle Manor</option><option>Inquiry about item(s) in catalog</option><option>Feedback for Monkeypuzzle Manor</option><option>Feedback about item(s) in catalog</option><option>Other question/comment type</option></select></td></tr>
    <br />
    <input type="submit" value="Send Message"><input type="reset" value="Clear Fields">

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.18857 seconds
  • Memory Usage 2,877KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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 (71):
  • 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
  • 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