...

View Full Version : 'update' submit button



Faeroph
10-27-2002, 12:31 PM
hey all

below is a code that i'm trying to alter from an avidgamers community. i've added something to it (in bold), but when i load the created page, the text entered in the new field does not update when the update button is clicked, even though the extra code is a copy of code that does update. The code for the submit button is in italics.

i'm confusing myself.




<p><h3>Account setup for [uname]</h3>
<table border=1 cellpadding=3 cellspacing=0><tr><td>
<form method=post action="account.php">
<table border=0 cellpadding=3 cellspacing=0>
<tr><td align=left valign=top>Username:</td>
<td align=left><input type=text size=25 maxlength=80 name="uname" value="[uname]"></td></tr>
<tr><td align=left valign=top>Login name (optional):</td>
<td align=left><input type=text size=25 maxlength=80 name="login_name" value="[login_name]"><br><small>(if left blank, username is used)</small></td></tr>
<tr><td align=left valign=top>Combat Level:</td>
<td align=left><input type=text size=5 maxlength=3 name="cmbt" value="[cmbtlevel]"></td></tr>
<tr><td align=left valign=top>Email:</td>
<td align=left><input type=text size=30 maxlength=150 name="email" value="[email]"><br>
<input type=checkbox name="show_email" checked[endif:show_email]> Show email in member list</td></tr>
<tr><td align=left valign=top>ICQ:</td>
<td align=left><input type=text size=15 maxlength=12 name="icq" value="[icq]"></td></tr>
<tr><td align=left valign=top>AIM:</td>
<td align=left><input type=text size=20 maxlength=100 name="aim" value="[aim]"></td></tr>
<tr><td align=left valign=top>Info:</td>
<td align=left><textarea cols=25 rows=3 wrap=soft name="info">[info]</textarea></td></tr>
[i]<tr><td></td><td align=left valign=top><input type=submit name=update value="Update"></td></tr></table>
</form>
</td></tr></table></p>
<p><h3>Change password</h3>
<table border=1 cellpadding=3 cellspacing=0><tr><td>
<form method=post action="account.php">
<table border=0 cellpadding=3 cellspacing=0>
<tr><td align=left valign=top>New password:</td>
<td align=left><input type=password size=20 maxlength=40 name="password"></td></tr>
<tr><td align=left valign=top>Repeat password:</td>
<td align=left><input type=password size=20 maxlength=40 name="password_repeat"></td></tr>
<tr><td></td><td align=left valign=top><input type=submit name="pass_change" value="Change password"></td></tr></table>
</form>
</td></tr></table></p>



any ideas as to why the new 'combat level' field does not update, even though the 'icq' and 'aim' fields do?

much appreciated,

fae

ShdwStal
10-27-2002, 10:08 PM
Why of course not. Look again:

<tr><td align=left valign=top>Combat Level:</td>
<td align=left><input type=text size=5 maxlength=3 name="cmbt" value="[cmbtlevel]"></td></tr>

There is no variable named "[cmbtlevel]"; only "[cmbt]".
Change it to either one of these:

<tr><td align=left valign=top>Combat Level:</td>
<td align=left><input type=text size=5 maxlength=3 name="cmbt" value="[cmbt]"></td></tr>

or

<tr><td align=left valign=top>Combat Level:</td>
<td align=left><input type=text size=5 maxlength=3 name="cmbtlevel" value="[cmbtlevel]"></td></tr>


btw, why not post this in AG public boards instead?

PS: For those of you who don't what avidgamers is, click here (http://www.avidgamers.com).

Faeroph
10-29-2002, 10:38 PM
hmm..i'll have to try..i thought the name of the "text" item wasnt related to the name of its variable...still, its worth a shot :)

btw, i posted this here cos you guys are the first ppl i thought of :) even though Adamlucas has been inactive for over half a year..:)

-edit-

wahey :) it works :) thanks a million :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum