Populating Select <option>s with form/frame/js

Discussion in 'Javascript' started by Robert Kattke, Mar 4, 2004.

  1. I'm designing a site for local music and entertertainment and have a
    few ?s that need to be cleared up. Currently, I'm working on the Club
    part and have a Contact Person form, and a Club form. For the Club
    form, I'd like to have up to 4 Contacts with various roles, {Booking,
    Manager, Owner, All}.

    Ideally, I'd like to have a frameset and have Contact form filled out
    1st, allowing me to set a cookie that would populate the
    <select><option>s on the Club form, with a Short list of names (1-3)
    that have been entered with Contacts.

    Possibly, I could even add (using Java Servlets/JSP and MySQL) a
    numeric value, supplied by MySQL for the Contact index, for the
    <option value=""> after the Contact was entered to get
    hypothetically:

    <option value="362">Paul Mason</option>
    <option value="363">Greg Kimball</option>

    This should created easy form entries for the user, If I can get thru
    the details. What is the best way to access a text field on a form ??
    Use forms[0] or a named form ? or ??
    ex: document.forms[0].firstname.value

    Also, my onSubmit="myfunc()" which calls alert() and setCookie()
    does not seem to be executing. Not sure why.

    My other strategy would be to make the 2nd Club page a .jsp file and
    make sure it got reloaded. using
    top.frames['club'].location.href='ClubEntry.jsp'

    My goal easy short cross-referenced data entry. any suggestions ?
    Robert Kattke, Mar 4, 2004
    #1
    1. Advertising

  2. Figured out a few of my own errors. And I'll start with the
    corrections
    onSubmit="return doCKinit(this)" place as an attr in the <form>
    tag.
    use <div id="myID">blah, blah, blah </div>

    use the following function
    function writeToDiv(div, str)

    I still have few questions though; I'm apparently not setting the
    cookie value, or at least not getting it back.
    Re:
    function Set_Cookie(name,value,expires,path,domain,secure)

    Do all the param's need to be passed to call this function ?
    In other words include null's so the # of params match ?

    What format should the expires param be in ?
    How can it be used as an offset from now() ?

    ~~~~~~~~~~~~~~~
    The following is a snippet of psuedo-code that doesn't seem to be
    working together very well.

    Contact_Code:
    Set_Cookie("clubk", old_clubk+":"+CK, 60*60, null, null, null );

    top.frames['club'].location.href="Club_Form_js1.html";

    Club_Code:
    var Cval = Get_Cookie("clubk");
    alert("Cval is: " + Cval );


    Still searching.
    Robert Kattke, Mar 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J. Hall
    Replies:
    2
    Views:
    1,039
    Jeff Thies
    Apr 21, 2004
  2. WebRaster
    Replies:
    1
    Views:
    258
    Francisco Spaeth
    Oct 26, 2005
  3. Replies:
    7
    Views:
    239
  4. Nick Spacek

    Removing select option removes entire select

    Nick Spacek, Jun 21, 2006, in forum: Javascript
    Replies:
    1
    Views:
    141
    Matt Kruse
    Jun 21, 2006
  5. rvelosoo
    Replies:
    1
    Views:
    316
    Bart Van der Donck
    Aug 13, 2008
Loading...

Share This Page