Jump to content

Recommended Posts

Posted

I'm trying to change the value of an input box that is in a form with no name. What do I do here if I can't reference it using a name?

Posted (edited)

From http://www.testingsecurity.com/how-to-test...cript-Injection

__________________________________________________________________________________________________

You can also use javascript to modify any value with an html form, including hidden forms, and disabled forms. The following is an example of how you would set an input tag named email within form number 0 (or the first form on the page)

java script:void(document.forms[0].email.value="test@test.com");

___________________________________________________________________________________________________

Basically it works like this:

java script:-------------------Declares a javascript function

void()-------------------------The javascript funciton to run

document---------------------Pointing to the current page...

forms[0]----------------------First form on the page(starts at 0)...

email--------------------------name of the input field you with to modify...

value=""----------------------The value you wish to set in the above field

You would run this as a URL in DOS or there s probably an IE.au3 function you can use.

_RunDos('start java script:void(document.forms[0].email.value="test@test.com");')

Dont do anything illegal :rolleyes:

Edited by Mast3rpyr0
Posted (edited)

Nevermind, the second one is the one that needs to be changed.

Thank-you for all the help!

EDIT: How do I submit a form that way?

Edited by Shyke
Posted

"java script:void(document.forms[0].submit());"

^ That will submit the form.

Now another problem. Using Javascript to change the stuff seems to work, but when you submit, it shows that you didn't enter anything.

  • Moderators
Posted

I'm trying to change the value of an input box that is in a form with no name. What do I do here if I can't reference it using a name?

Look at _IEFormGetCollection() in the help file.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...