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 6757695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:41:06+00:00 2026-05-26T13:41:06+00:00

Inside my html file I call a javascript function that takes two parameters, where

  • 0

Inside my html file I call a javascript function that takes two parameters, where the second parameter is the name of a file that should be saved.

<a id="record_button" onclick="Recorder.record('audio', 'test.wav');" href="javascript:void(0);" title="Record"><img src="images/record.png" width="24" height="24" alt="Record"/></a>

I would like to make a dynamic variable that takes the value from a textfield and forward that as the second parameter (instead of test.wav), so the user can determine the name of the file.

<label for="filename">Filename</label>
<input name="filename" type="text">

Thanks.

  • 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-26T13:41:06+00:00Added an answer on May 26, 2026 at 1:41 pm

    This is easier if you give your user input an id attribute:

    <input name="filename" id="filename" type="text">
    

    Now you can access the value in Javascript with:

    document.getElementById('filename').value
    

    Note that, if you aren’t controlling the Recorder.record() method, you’ll need to validate the user input first (at a minimum, to verify that they’ve entered something). I’d recommend moving this to a separate function, e.g.:

    function recordToFilename() {
        var input = document.getElementById('filename'),
            fileName = input.value;
        if (fileName) {
            Recorder.record('audio', fileName);
        } else {
            alert('Please enter a filename!');
            input.focus();
        }
    }
    

    Then just use that function:

    <a id="record_button" onclick="recordToFilename();" href="javascript:void(0);" title="Record"><img src="images/record.png" width="24" height="24" alt="Record"/></a>
    

    Working example: http://jsfiddle.net/nrabinowitz/GFpRy/

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

Sidebar

Related Questions

I am trying to basically call a function from another javascript file (inside a
I have one entire html openning inside an iframe that contains a javascript function
I have javascript code embedded inside a html template file. When I load this
I am using jQuery and JavaScript, I need to call the jQuery function inside
For example: script.js: function functionFromScriptJS() { alert('inside functionFromScriptJS'); } iframe.html: <html> <head> <script language=Javascript
How can include .asp file inside of html file and have it proccessed besides
If I create a simple .html file with a table inside it. Within one
Inside my index.html.erb <script type= text/javascript> var msg = Hello World ; </script> i
I got a js function that is defined in a JScript.js file. This file
I have an SVG file embedded into an HTML document inside . I can

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.