-
[RESOLVED] Submit HTML form in VB
Hello All, I am new to VB. I just want a program compiled in Visual Basic 2008 or VB6 portable. which can just submit a form of only one field, i don't want to go to that url every time to do so.
What I want here, just to open exe, fill that field and submit. can anyone describe in detailed step by step? or just write the complete code.
the HTML code for that form is <form name='enterMsisdn' action='http://www.target.com/authenticate.jsp' method='post'>
<textarea name='msisdn' rows='1' cols='10'></textarea>
<input type='submit' name='submit' value='Add Comment'>
</form>
-
Re: Submit HTML form in VB
did you search this form?there about 100 example
Quote:
Originally Posted by
wiqionline
Hello All, I am new to VB. I just want a program compiled in Visual Basic 2008 or VB6 portable. which can just submit a form of only one field, i don't want to go to that url every time to do so.
What I want here, just to open exe, fill that field and submit. can anyone describe in detailed step by step? or just write the complete code.
the HTML code for that form is <form name='enterMsisdn' action='http://www.target.com/authenticate.jsp' method='post'>
<textarea name='msisdn' rows='1' cols='10'></textarea>
<input type='submit' name='submit' value='Add Comment'>
</form>
-
Re: Submit HTML form in VB
Can you please refer one example?
-
Re: Submit HTML form in VB
I don't understand where to put action URL in button.
-
Re: Submit HTML form in VB
you have to submit the form to the website, how are you going to send the data, an inet control, webbrowser control or other method? there are several choices
-
Re: Submit HTML form in VB
ok please be more detailed on what you want done where the form at on the target website you want to submit?
-
Re: Submit HTML form in VB
thanks for response and Yes the form is on the website. i just want to submit that form from vb application. please please please do write here the complete source that i can just copy and paste to my vb code.
-
Re: Submit HTML form in VB
Quote:
please please please do write here the complete source that i can just copy and paste to my vb code.
no way, we are here to help, not do it for you
you still did not say what method you want to use to 'post' the data
-
Re: Submit HTML form in VB
my dear I want a one field form to be submitted using a VB compiled application. text where field name is 'msisdn' form name is 'entermsisdn' and button is 'submit'. target url where form should be posted is 'http://example/authenticate.jsp'
Here is the html page coding:
<form name='enterMsisdn' action='target url/authenticate.jsp' method='post'>
<textarea name='msisdn' rows='1' cols='10'></textarea>
<input type='submit' name='submit' value='Add Comment'>
</form>
guide me the complete source code for VB. Thanks in advance.
-
Re: Submit HTML form in VB
that would be called help if u guide me to do.
-
Re: Submit HTML form in VB
Quote:
that would be called help if u guide me to do.
Yes.. We will guide you... :wave:
Check this thread... : http://www.vbforums.com/showthread.php?t=384076
Particularly, this post...: Auto Submit
-
Re: Submit HTML form in VB
Thanks a lot dude u worked for me but problem is still here. in debug, name "WebBrowser1" is not declared. What to do?
-
Re: Submit HTML form in VB
You have to add a WebBrowser control to your form.
Press ctrl + T (or, Project menu -> Components). From the list, select and put check mark on Microsoft Internet Controls. Then press OK. Now, your toolbox will contain a tool with an Earth's icon. That is webbrowser control. Select it and add it to your form.... :wave:
-
Re: Submit HTML form in VB
Thanks dear very very thanks again, that really helped me a lot. I have succeed navigating the target page. i wanted not to appear target page so changed the visible to false. worked. but now the main thing. i don't have idea to submit form by clicking vb's submit button. how to attach textbox to submit button and submit button effect to target url.
Further Thanks in advance.....
-
Re: Submit HTML form in VB
I get the same problem i just used web browser1 a few mins ago and now its gone! Please help me!
-
Re: Submit HTML form in VB
follow the instruction as above. but i am still in trouble that how to attach the textbox to the submit button and then navigate to submit form.
-
Re: Submit HTML form in VB
Quote:
Originally Posted by
wiqionline
Hello All, I am new to VB. I just want a program compiled in Visual Basic 2008 or VB6 portable. which can just submit a form of only one field, i don't want to go to that url every time to do so.
What I want here, just to open exe, fill that field and submit. can anyone describe in detailed step by step? or just write the complete code.
the HTML code for that form is <form name='enterMsisdn' action='http://www.target.com/authenticate.jsp' method='post'>
<textarea name='msisdn' rows='1' cols='10'></textarea>
<input type='submit' name='submit' value='Add Comment'>
</form>
using the name of the fields, and the AutoSubmit code(link posted above), will work. But before that, don't put the visibility of that control to false. After you have succeeded in doing what you needed you can do whatever modification needed.... :wave:
-
Re: Submit HTML form in VB
Dear it auto fills the webbrowser form. I want to fill manually in textbox created in vb. and that should be posted to the target url.... I think no one is understanding my problem.
I should surrender...
-
Re: Submit HTML form in VB
That's never a good attitude to have :P
What you need to do is add a TextBox control to your Form. Then, in the Auto Submit code (linked above), where it says "strwebsite = ", put "strwebsite = Text1.Text" instead of the URL that is already input in that code.
Let me know if that solves your problem. :)
-
Re: Submit HTML form in VB
Quote:
Originally Posted by
wiqionline
Dear it auto fills the webbrowser form. I want to fill manually in textbox created in vb. and that should be posted to the target url.... I think no one is understanding my problem.
I should surrender...
Check this thread: http://www.vbforums.com/showthread.php?t=334645 .... :wave:
-
Re: Submit HTML form in VB
aaaghhhhhhhh.......
addurl is not a member of system.windows.forms.HTMLdocument
-
Re: Submit HTML form in VB
What version of VB are you using...??? Is that VB6 or VB.Net(includes VB2008,VB2005,etc...) ...? :confused:
-
Re: Submit HTML form in VB
OK Well, all thing is done, page loaded in webbrowser1 within VB but when i click on submit button, nothing happens......
-
Re: Submit HTML form in VB
is this necessary to navigate to the page of loading of form? i don't need the form to be loaded. i just just just just just submit the textfield to the target url.
-
Re: Submit HTML form in VB
Check whether it is working or not(before hiding)... After that, try hiding the control....
-
Re: Submit HTML form in VB
Quote:
Originally Posted by
akhileshbc
What version of VB are you using...??? Is that VB6 or VB.Net(includes VB2008,VB2005,etc...) ...? :confused:
What is the answer to this question?
-
Re: Submit HTML form in VB
VB6. that error occurred in visual basic 2008. now i am back on vb6.
The person who understands HTML coding and VB6 coding, can only guide me to resolve my issue. it's just simple but i don't know how. one field named "msisdn" one button named "submit" and submitting that field through submit button to target url. Why aren't yo ppl getting my point???? :blush:
-
Re: Submit HTML form in VB
Ok i have made this thing. made one textbox named "msisdn", one button named "Submit" and webbrowser1 added to form.
That something look like this.
Private Sub Submit_Click()
Dim txt As String
txt = "msisdn.text"
WebBrowser1.Document.addurl.URL.Value = txt
WebBrowser1.Document.addurl.Submit
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "http://dms.telenor.com.pk/sca_tp/authenticate.jsp"
End Sub
Hitting F5, form loads web page in webbrowser1. clicking Submit button in form error occurred
Run-Time '438' Object doesn't support this property of method.
and debugging highlights the line
WebBrowser1.Document.addurl.URL.Value = txt
Now I think much detail.
-
Re: Submit HTML form in VB
you need to look at the source page of the website to find the correct names for the text input of that page
you can try this where wb is the name of your webbrowser control
vb Code:
wb.navigate2 "http://dms.telenor.com.pk/sca_tp/login.jsp?"
Do Until wb.readystate = 4
DoEvents
Loop
Set f = wb.document.forms(0)
f.all("msisdn").Value = "1235"
f.submit
tested works, change the literal value (1235) for your textbox
f.all("msisdn").Value = text1.text
-
Re: Submit HTML form in VB
Quote:
Originally Posted by
westconn1
you need to look at the source page of the website to find the correct names for the
text input of that page
you can try this where wb is the name of your webbrowser control
vb Code:
wb.navigate2 "http://dms.telenor.com.pk/sca_tp/login.jsp?"
Do Until wb.readystate = 4
DoEvents
Loop
Set f = wb.document.forms(0)
f.all("msisdn").Value = "1235"
f.submit
tested works, change the literal value (1235) for your textbox
f.all("msisdn").Value = text1.text
:thumb::thumb::thumb:
Thanks party you are the MAN :cool: I Love You
now could you or anyone help me out for looping? i removed your do event loop because that is not working anymore.
Thanks again :wave:
Need Looping..... untill form closed. Also form should work when webbrowser1 visibility set to false. but at this time it's not working.
-
Re: [RESOLVED] Submit HTML form in VB
if you do not loop until the web browser is ready you will get an error, that loop is essential, though doevents is not and can be omitted, just may freeze computer while waiting for the page to load
this should work fine when web browser not visible
Quote:
Need Looping..... untill form closed.
i have no idea what you mean by this
to close the form after submitting
-
Re: [RESOLVED] Submit HTML form in VB
Well i have to put 2 buttons. one for start submitting simultaneously and second to stop submitting. how would 1st button be set to start submitting until 2nd button pressed. repeat or loop whatever need.
-
Re: [RESOLVED] Submit HTML form in VB
Do you mean, Start button will open the form for sending and close button will close the form....like that...??? :confused:
-
Re: [RESOLVED] Submit HTML form in VB
no no no akhil. well i have done. using do while cancel procedure. Thanks a lot all...........
now can I have exe that can not be recovered as vb script???? any decompiler can not read source code..... any idea?
-
Re: [RESOLVED] Submit HTML form in VB
File menu -> Make EXE will create the EXE....