SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript forms and functions

    Hey guys,

    I'm having an annoying problem that I can't solve as it works in Firefox but not in IE or Opera.

    I've got a javascript function that I've setup that reads a form and a textbox inside the form for processing.

    E.g.
    function quote(txbox, post_id, uname) {
    var post_text = document[post_id][txbox].value;
    }

    post_id would be the form's name.
    txbox is the text box's name.

    In Firefox it works fine and does the job, but in IE and Opera I get an error like:

    message: Statement on line 300: Could not convert undefined or null to object

    Please advise! I'm not too sure how I can get it to read the value of the text box as the function is applied to many different forms.

    Thanks in advance!

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2007
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where is your script on the page? Is it running before the page has fully loaded?

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Script is in the header, and I've tried it once the page has loaded fully - not sure whats causing the error as it works in one browser but not the next.


Bookmarks

Posting Permissions

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