|
-
Feb 8th, 2010, 01:24 AM
#1
Thread Starter
Junior Member
[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>
-
Feb 8th, 2010, 01:33 AM
#2
Fanatic Member
Re: Submit HTML form in VB
did you search this form?there about 100 example
 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>
Live life to the fullest!!
-
Feb 8th, 2010, 01:44 AM
#3
Thread Starter
Junior Member
Re: Submit HTML form in VB
Can you please refer one example?
-
Feb 8th, 2010, 02:11 AM
#4
Thread Starter
Junior Member
Re: Submit HTML form in VB
I don't understand where to put action URL in button.
-
Feb 8th, 2010, 03:41 AM
#5
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 8th, 2010, 03:42 AM
#6
Fanatic Member
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?
Live life to the fullest!!
-
Feb 8th, 2010, 06:21 AM
#7
Thread Starter
Junior Member
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.
-
Feb 8th, 2010, 06:38 AM
#8
Re: Submit HTML form in VB
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 8th, 2010, 06:44 AM
#9
Thread Starter
Junior Member
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.
-
Feb 8th, 2010, 06:47 AM
#10
Thread Starter
Junior Member
Re: Submit HTML form in VB
that would be called help if u guide me to do.
-
Feb 8th, 2010, 08:22 AM
#11
Re: Submit HTML form in VB
that would be called help if u guide me to do.
Yes.. We will guide you... 
Check this thread... : http://www.vbforums.com/showthread.php?t=384076
Particularly, this post...: Auto Submit
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 8th, 2010, 10:13 AM
#12
Thread Starter
Junior Member
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?
-
Feb 8th, 2010, 10:34 AM
#13
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....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 8th, 2010, 03:29 PM
#14
Thread Starter
Junior Member
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.....
-
Feb 8th, 2010, 07:54 PM
#15
New Member
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!
-
Feb 8th, 2010, 08:07 PM
#16
Thread Starter
Junior Member
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.
-
Feb 8th, 2010, 09:24 PM
#17
Re: Submit HTML form in VB
 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....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 8th, 2010, 10:24 PM
#18
Thread Starter
Junior Member
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...
-
Feb 8th, 2010, 10:35 PM
#19
Addicted Member
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.
-
Feb 9th, 2010, 07:14 AM
#20
Re: Submit HTML form in VB
 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 ....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 9th, 2010, 09:46 AM
#21
Thread Starter
Junior Member
Re: Submit HTML form in VB
aaaghhhhhhhh.......
addurl is not a member of system.windows.forms.HTMLdocument
-
Feb 9th, 2010, 10:20 AM
#22
Re: Submit HTML form in VB
What version of VB are you using...??? Is that VB6 or VB.Net(includes VB2008,VB2005,etc...) ...?
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 9th, 2010, 10:34 AM
#23
Thread Starter
Junior Member
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......
-
Feb 9th, 2010, 10:36 AM
#24
Thread Starter
Junior Member
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.
-
Feb 9th, 2010, 10:46 AM
#25
Re: Submit HTML form in VB
Check whether it is working or not(before hiding)... After that, try hiding the control....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 9th, 2010, 11:32 AM
#26
Re: Submit HTML form in VB
 Originally Posted by akhileshbc
What version of VB are you using...??? Is that VB6 or VB.Net(includes VB2008,VB2005,etc...) ...? 
What is the answer to this question?
-
Feb 9th, 2010, 01:17 PM
#27
Thread Starter
Junior Member
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????
-
Feb 9th, 2010, 01:39 PM
#28
Thread Starter
Junior Member
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.
-
Feb 9th, 2010, 04:03 PM
#29
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 9th, 2010, 04:46 PM
#30
Thread Starter
Junior Member
Re: Submit HTML form in VB
 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
  
Thanks party you are the MAN 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 
Need Looping..... untill form closed. Also form should work when webbrowser1 visibility set to false. but at this time it's not working.
Last edited by wiqionline; Feb 9th, 2010 at 05:09 PM.
-
Feb 9th, 2010, 09:40 PM
#31
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
Need Looping..... untill form closed.
i have no idea what you mean by this
to close the form after submitting
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 10th, 2010, 03:49 PM
#32
Thread Starter
Junior Member
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.
-
Feb 10th, 2010, 09:02 PM
#33
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...???
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Feb 10th, 2010, 09:11 PM
#34
Thread Starter
Junior Member
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?
-
Feb 10th, 2010, 09:15 PM
#35
Re: [RESOLVED] Submit HTML form in VB
File menu -> Make EXE will create the EXE....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|