Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

question about javascript....


BluePain's Avatar
Member
0 0

Hey, I am trying to learn me some javascript. Injections and are exprementig with forms and tabels. Lets say I have this form:


<span class="jsdesc">admin?</span>
<input type="text" name="admin" value="no" readonly="readonly" style="text-align:center"; size="3"><br>
<input type="submit" value="submit">
</form>```

Then can I use this line to get the no to yes:

javascript:void(document.forms[0].admin.value="yes");

But if I have a form like this:

```markup
<form action="" method="post">
<select name="user">
<option value="newguy" name="newguy">newguy
<option value="standarduser" name="standarduser">standarduser
<option value="hid" name="hid">his
</select>
<br>
<input type="submit" value="Submit Username">
</center>
</form>

And want to change the names there with javascript. Eks. hid goes to admin. How can I do that? Thanks for helping me out here.


I-O-W-A's Avatar
[Forever Blind To See]
0 0

same way you did the first one but aim the injection at the options thqt way it'll change them


BluePain's Avatar
Member
0 0

can you give me an example, because the options I try wont work.


I-O-W-A's Avatar
[Forever Blind To See]
0 0

javascript:void(document.forms[0].option.hid.value="whateveryouwant";)

theoreticly tht should work


ghost's Avatar
0 0

javascript:alert(document.forms[0].user[2].value="admin")

will work, just change the number 2 to what ever number the option is (In your example it is 2, because the option box is zero based)