Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 09-05-2007, 09:20 PM Onchange event help
Junior Talker

Posts: 1
Trades: 0
I need immediate help with this script. When I change the drop down box to 'Picture' I need the the 'reason2' field to automatically have a value of 'When a real picture gets uploaded'
Code:
<script type="text/javascript">
<!--
function photo(x)
{
var y=document.getElementByName(x).value
if(document.getElementByName(x).value == "Picture"){
document.getElementByName("reason2").value == "When a real picture gets uploaded";
}
}
//-->
</script>
      <form action="forum.php?step=banuser" method="POST">
        <b><u>Ban Player</u></b><br /><br />
        <b>ID: <input name="id" value="' . $id .'" /> Reason:
        <select name="reason" OnChange="photo(this.name)">
          <option value="Spamming">Spamming</option>
          <option value="Picture" OnClick="document.getElementByName(\'reason2\').value=\'When Real Photo is Uploaded\'">Picture</option>
          <option value="Excessive Linking to Other Sites">Excessive Linking to Other Sites</option>
          <option value="Racism">Racism</option>
          <option value="Foul Language">Foul Language</option>
          <option value="Disrespect">Disrespect</option>
        </select>
        Unban: <input type="text" name="reason2" value="MM/DD/YY" /></b>
        <input type="submit" name="submit" value="Ban!">
      </form>
loganbest is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-06-2007, 08:09 AM Re: Onchange event help
logic ali's Avatar
Super Talker

Posts: 104
Trades: 0
Quote:
Originally Posted by loganbest View Post
I need immediate help with this script.
Then use the JavaScript console, which is trying to help you.
logic ali is offline
Reply With Quote
View Public Profile
 
Old 09-07-2007, 02:30 AM Re: Onchange event help
Novice Talker

Posts: 13
Name: Ham
Location: Singapore
Trades: 0
Quote:
document.getElementByName("reason2").value == "When a real picture gets uploaded";
= instead of ==
__________________
HAFIOŠ Networks -
Please login or register to view this content. Registration is FREE

Exclusive webhosting services
hafio is offline
Reply With Quote
View Public Profile Visit hafio's homepage!
 
Reply     « Reply to Onchange event help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.68720 seconds with 12 queries