Jump to content

Changing Default


Xtremer360

Recommended Posts

When the page loads I want the default to say in the UL that "This handler does not have any characters assigned." until a characterid is selected from the drop down and added to the ul then it replaces the phrase. What do I need to change?

 

	print '<h2 class="backstage">Characters<br /><br />';
    print '<form method=post name="addwrestler" onsubmit="return WrestlerList(this);">';
    $query = 'SELECT charactername FROM characters';
print'<select name="characterid" class="dropdown">';
print '<option value="">- Select -</option>';
    $result = mysql_query ( $query );
        while ( $row = mysql_fetch_assoc ( $result ) ) {
        print "<option value=\"".$row['charactername']."\">".$row['charactername']."</option>\r";
        
    }
print '</select>';
print'  <input name="submit" type="button" value="Add" class="button"></form></h2><br />'; 
{
print 'This handler does not have any characters assigned.<br /><br />';
}
else {     
    print '<ul id="characterlist"></ul>';  
print '<h2 class="backstage"><form method="post"><input type="submit" value="Return to Main Menu" class="button200"></form></h2>';
}

Link to comment
https://forums.phpfreaks.com/topic/140395-changing-default/
Share on other sites

I'm sort of guessing about what you want, because your question is not very clear. If you want the phrase to change when somebody selects an option, then you're going to use javascript to replace the innerHTML of an elements ID (which you access by getElementByID()). You will need to use an event handler to have javascript do this. This is simple stuff. Good luck.

Link to comment
https://forums.phpfreaks.com/topic/140395-changing-default/#findComment-734839
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.