Xtremer360 Posted January 11, 2009 Share Posted January 11, 2009 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>'; } Quote Link to comment https://forums.phpfreaks.com/topic/140395-changing-default/ Share on other sites More sharing options...
sKunKbad Posted January 11, 2009 Share Posted January 11, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/140395-changing-default/#findComment-734839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.