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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:00:41+00:00 2026-05-29T09:00:41+00:00

I have a multipart form to create a custom stamp. I have the main

  • 0

I have a multipart form to create a custom stamp. I have the main chunck of it working just fine, but am battling to get the border to take on the same colour of the text colour selection. I have a dropdown list for the border px and a dropdown list for the font color. The font colour works, i need the border to work and to take the same colour as the font color.
Can you let me know what i have done wrong here.

http://jsfiddle.net/ShauniD/ELER2/11/ (this is the full code, so you can see what i am trying to achieve.

I know there are better methods of doing this, but i am very new,and am learning piece for peice. So go easy if you will.

The Javascript is as follows:

function setColor()   {     
var color = document.getElementById("color").value;     
document.getElementById("myDiv").style.color = color;   
} 
function addContent(divName, content) {
 document.getElementById(divName).innerHTML = content;
}
 function border(border)    {
document.getElementById("myDiv").style.borderWidth = border;
}

The HTML is as follows:

    <tr>

        <td>
            <input name="myContent1"></input>
            <input type="button" value="Add content" onClick="addContent('lineTwo', document.myForm.myContent1.value); setCookie('content', document.myForm.myContent1.value, 7);">
        </td>
</tr>
<tr><td>
 <select id="color" onclick="setColor();">
        <option value="white">white</option>           
        <option value="black" selected="selected">black</option>           
        <option value="red">red</option>           
        <option value="lightblue">light blue</option>           
        <option value="darkblue">dark blue</option>           
        <option value="lightgreen">light green</option>           
        <option value="darkgreen">dark green</option>           
        <option value="yellow">yellow</option>           
        <option value="orange">orange</option>           
        <option value="pink">pink</option>           
        <option value="purple">purple</option>           
        <option value="gray">gray</option>         
    </select></td></tr> 
    <tr><td>
    <select id="border"  onchange="border(this.value);">
        <option value="1px solid" selected="selected">1px</option>
        <option value="2px solid">2px</option>
        <option value="3px solid">3px</option>
        <option value="4px solid">4px</option>
        <option value="5px solid">5px</option>
    </select></td></tr>
</form>

<div id="myDiv">
        <div id="lineOne"></div>
        <div id="lineTwo"></div>
        <div id="lineThree"></div>
        <div id="lineFour"></div>
    </div>

Please have a look at the full code, so as to understand what it is exactly i am doing.

  • 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-29T09:00:42+00:00Added an answer on May 29, 2026 at 9:00 am

    Change the name of your function, for example to ‘changeborder’ and it will works for you.

    The browser don’t agree to use the same name as the element.

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

Sidebar

Related Questions

I have the form having the follwing fields, <form onsubmit=return checkcreateform() action=/gallery/create method=post enctype=multipart/form-data>
I have the below form in my view: <% form_for(@filedata, :url=>{ :controller=>filedatas, :action=>create}, :multipart
I have a multipart form that takes basic user information at the beginning with
I have a dialog form. <div id=dialog-form title=Create new Admin> <p class=validateTips>All form fields
I have such a form <form name= method=post action=Save enctype=multipart/form-data> <div id=dialog title=Upload files>
Ok, I have an in template function that get's submitted via method=POST. But I
I have many forms which are working fine if i load them via normal
This is my markup: <form action=/Customer/Create enctype=multipart/form-data method=post> <input id=file type=file style=width:300px /> <input
I have the following form setup: <html> <head></head> <body> <form method=post enctype=multipart/form-data action=FileUpload> <table>
I want to create a form in which i have some textfields and a

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.