|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is it possible to do the following?
I am asking about writing a script that will allow me to run it like a batch file on my desktop. Where I can click it and it will open the browser to a search engine page (of my boss' creation) with one text field and one button. In that script, it will have a string that has a word in it, say: Doctor, which it will put it into the text field. Once that is done, it will then automatically click the button which will send the information. So, a brief recap; 1) I need to get a script that fills in a field with a word. 2) Once that word is in the field, it will automatically press the button on the webpage. 3) Once that button is pressed, it then will search for that word 'Doctor' and display the results. I wish I could be more specific. However this was all the information that was given to me. All I know is that my boss wants to be able to press an icon on his desktop that will run the script which opens a website address (which I do not have). Have a word inserted into a text field and have that webpage automatically press the Search Button and display the results. I hope this helps you guys out somewhat, because I'm just confused on what he is trying to accomplish. |
|
#2
|
||||
|
||||
|
You could do this by just creating a simple HTML page, with a form. The user open the page (either thru a shortcut or has the actual page on their desktop). They enter in the word, press Enter to submit the form, which posts to wherever you want it to go.
No server-side programming is needed... just simple HTML (forms). At least this is what i think you want... i couldn't really understand your post. |
|
#3
|
|||
|
|||
|
Stumpy:
Yes that is the basic Idea, with the shortcut on the desktop and the HTML Form... However, when you click on the Desktop Icon, my boss wants it to Automatically have the word already entered into the form. Once that word is in the Form, have a script press the Button and have it search for that word... |
|
#4
|
||||
|
||||
|
How is the word sposed to be entered into the form? It's simple to have the one single word in the form all the time (<input type="text" value="Blah">), but what's the point in having the same word every time?
As far as automatically submitting. How is the form sposed to know when the word ends? |
|
#5
|
|||
|
|||
|
Stumpy;
You are right with the (<input type="text" value="Blah">) because that is what I was thinking as well... As for what is the point of having the same word everytime... That I do not know.... As far as automatically submitting. That is where I think scripting of some kind is able to help. A friend of mine told me that in VB.NET, I would have to look up Weblinks, Webforms and then finally: AutoResponse to see if I could get this to work... |
|
#6
|
||||
|
||||
|
You can auto submit with some Javascript, but i just don't see what you are try to achieve by submitting the same word everything time.
To auto submit a form after the page has loaded: <body onload="document.forms[0].frmName.submit()"> |
|
#7
|
|||
|
|||
|
Honestly Stumpy, I wish I knew why I would be submitting the same word over and over again searching for whatever the word is.
However, I do not... |
|
#8
|
||||
|
||||
|
hehe - okay - employers make odd requests sometimes.
Hope I've solved your problem anyway. |
|
#9
|
|||
|
|||
|
Then the question is Stumpy,
When I put this javascript into the body of the html document, What Frm am I calling... Can I create it in VB or Can I create it in HTML.... I'm just not quite understanding that particular code that's all... |
|
#10
|
||||
|
||||
|
It's all done with HTML & Javascript - no server side code necessary
|
|
#11
|
|||
|
|||
|
This is what I have so far...
Below is what I have so far.... Any suggestions?
[<html>] [<head>] [<title> Test Form </title>] [</head>] 1) It is this part that is confusing me... unless I have to give the form tag itself a name.... \/ [<body onload="document.forms[0].frmName.submit()">] [<table>] [<tr>] [<td>] [<FORM METHOD="POST" ACTION="mailto:kurtis@mastronardiproduce.com">] [<INPUT TYPE="text" NAME="name" SIZE="30" value="test" TITLE="This is the textbox that has a default value of 'test' in the Field">] [<INPUT TYPE="submit" name="Submit" TITLE="This is the Submit button which should Automatically Press when the above script runs...">] [</form>] [</td>] [</tr>] [</table>] [</body>] [</html>] |
|
#12
|
||||
|
||||
|
looks good. remove the square braces around everything tho... u don't need 'em
forms[0] simply refers to the first form in the forms array found in the page. There's only one form in our page, and it'll use that one. Alternatively, you can refer to the form by name (I prefer this method). So, give your form a name: <form name="frmSearch"> You can then refer to is like this: document.frmSearch You're almost done. |
|
#13
|
|||
|
|||
|
Only reason why I did the square brackets was to make sure that the code showed up
![]() Now that I've renamed the form tag to (see 'Here) below: <html> <head> <title> Test Form </title> </head> 'Here \/ <body onload="document.frmSearch.submit()"> <table> <tr> <td> <FORM METHOD="POST" name="frmSearch" ACTION="mailto:kurtis@mastronardiproduce.com"> <INPUT TYPE="text" NAME="name" SIZE="30" value="test" TITLE="This is the textbox that has a default value of 'test' in the Field"> <INPUT TYPE="submit" name="Submit" TITLE="This is the Submit button which should Automatically Press when the above script runs..."> </form> </td> </tr> </table> </body> </html> |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > AutoResponse and .NET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|