Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6111445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:37:52+00:00 2026-05-23T14:37:52+00:00

I have a form with a select dropdown, and my select tag looks like

  • 0

I have a form with a select dropdown, and my select tag looks like this:

<select name='preset' onchange='preset(this);'>

Right now I have my JavaScript function just do alert('test');. Well, when I change my selection in the dropdown, I’m getting an error saying “preset is not a function”. Yes, I verified that it’s spelled right, and I even did a generic call to it on page load and got my alert.

If I change my function name to something else, like presetx it works just fine. So I thought maybe “preset” was some kind of reserved word in JavaScript, but I can’t seem to find anything saying as such. Why would this happen?

Update

Currently I don’t have anything else on my test page except for my form and the function. No framework includes or other code, so I know it’s not anything like that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:37:53+00:00Added an answer on May 23, 2026 at 2:37 pm

    Some browsers map elements with name attributes to global variables. So <select name='preset' onchange='preset(this);'> actually creates (in some browsers) a global property preset. This overwrites the preset function.

    Since preset is now an HTMLSelectElement object, not a function, you get a “not a function” error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
I have a dojo (dijit) select dropdown that calls a js function onChange. I
The select form component in grails can have the form: <g:select name=user.age from=${0..59} value=${age}
I have a css dropdown menu with an HTML select form inside of that
I have some markup like this: <form id=ddlSelections runat=server> <asp:ScriptManager ID=ScriptManager1 runat=server EnablePartialRendering=true />
In one of my current projects I have a dropdown (select) form element. I
i have a form that has a multiple select drop down. a user can
I have a form with two text boxes, one select drop down and one
I have some problems sending an id though jquery. I have a form select
I have a select form element with 5 options. If option 2 is selected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.