Follow us on Twitter!
Hacking isn't just Computers & Exploits. It's a Philosophy. - Mr_Cheese
Friday, April 18, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 27
Guests Online: 26
Members Online: 1

Registered Members: 82828
Newest Member: uberscon
Latest Articles
View Thread

HellBound Hackers | Computer General | Web hacking

Author

form editing using javascript need some help

Mb0742
Member



Posts: 198
Location:
Joined: 26.11.07
Rank:
Apprentice
Posted on 02-10-08 08:27
I need this to edit a form using javascript and I would like to know the proper way to do it in javascript rather than using firebug, because I can't ask the people on my site to do the editing themselves. I want to be able to change their forms in real time.

What I need to know is how to edit what is submitted in a form. There is a button
<form id="myfrom">
<input type="submit" id="ready" value="ready" name="ready"/>
....

How do I using javascript change the form button values 'value' and 'name' from 'ready' to 'not ready'

Thank you guys so much.


Mb
javascript:alert("hi")
Author

RE: form editing using javascript need some help

spyware
Member



Posts: 4192
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 02-10-08 08:52
document.forms['formname'].elementname.value = "yourvalue";

Edit: Oh, and somewhere here there's probably a better solution.

Edit2: Damn you, xss filter. Somewhere here: http://www.javaBUSHADMINISTRATIONscripttoolbox.com/bestpractices/#forms

Remove the BUSHADMINISTRATION.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
[/s

Edited by spyware on 02-10-08 08:55
http://bitsofspy.net
Author

RE: form editing using javascript need some help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-10-08 12:19
Since your button has both a name and id, you have two options available to you. We're not going to get any deeper into the DOM at this point; the following methods are fine for what you're trying to achieve.

By name:
document.formname.elementname.value

By id:
document.getElementById(elementid).value