user1239398
user1239398

Reputation: 1791

How to get absolute URL in form action attr using MSHTML getAttribute method?

Here's the deal I have HTML code like this

<form action="/test.php">
First name: <input type="text" name="firstname" /><br />
Last name: <input type="text" name="lastname" />
</form>

I would like get full url like http://localhost/test.php calling getAttribute ( http://msdn.microsoft.com/en-us/library/aa752280(v=vs.85).aspx )

I'm trying to do it with the following code (Delphi)

formAction := form.getAttribute('action', 4);

but it only shows '/test.php'. How to make it work?

// Sorry for my bad english

Upvotes: 1

Views: 658

Answers (1)

Ashish Kumar Shah
Ashish Kumar Shah

Reputation: 532

  1. You get obtain the current URL from iwebbrowser2
  2. Do a string operation and get the complete URL.

Hope it helps.

Upvotes: 1

Related Questions