Fill field value while page is loading in HTML Page - html

I have a third part web address (www.samplespage.com). I call this page from another web site. is it possibe to fill some field values before page load or after page load? I tried vith URL parameters but It did not work.
www.samplespage.com?id=fieldId&value=fieldValue
This is how it looks like in codes. (I picked up from source via F12 Development tools in IE)
<input name="fieldName" id="fieldId" size="12" maxlength="11" value="">

When It's an HTML page It works with URL parameters otherwise You need to use like Selenium or Ptyhon ..

Related

how do I make a web browser display html in vb?

So I have a web browser, and it needs to login using html code that will get modified by textbox inputs. I know how to use the textbox inputs to modify the code, but how can I make the web browser run the code?
The code:
<form action="https://api.roblox.com/login/v1" method="post">
<input name="username" value="">
<input name="password" value="">
<button>Login</button>
so from what i can see there are three ways you can do this :
1) You can make the vb form enter the inputs required and submit the form in the background according to user inputs (which you have mentioned you already now about).However heres some code to do it :
WebBrowser1.Document.GetElementById("username").SetAttribute("value", TextBox1.Text)
WebBrowser1.Document.GetElementById("password").SetAttribute("value", TextBox2.Text)
WebBrowser1.Document.Forms(1).InvokeMember("submit")
2) You could also just save that html code as a html webpage and host it on a domain and then use this code to navigate it to your html page WebBrowser1.Navigate('http://www.yourhtmldomain.com')
3) If you want to run the html file from a local source lets say where the exe file for the web browser is located we would use this line of code ;
WebBrowser1.Navigate App.Path & "/mysite.html"

iOS 9 - Web Form Not Submitting When Photo Selected from Existing Library

I am creating a form in a web app that needs to upload an image file.
This should work whether you take a "new photo" or choose a file from your "existing library".
I am testing the form on iOS 9.1 and I can get it half-working.
If I take a NEW photo, then it works perfectly and advances to the success screen.
If I choose a photo from my existing library, then it does not work. It sort of appears like it's working, but then it just reloads the same page. The data never submits to the backend.
I'm using code I used with iOS 8 and if I recall, it worked properly.
This is what I have:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<form id="defaultForm" method="post" class="form-horizontal" action="/receipt-submit" enctype='multipart/form-data'>
<div class="form-group receiptContainer">
<div class='upload-photo' onclick="$('#receipt').click()">
<image src='/img/camera-icon.png' class='img-responsive' alt='' />Upload Your Receipt</div>
<div id="Ugly">
<input type="file" name="receipt" id="receipt" accept='image/*' />
</div>
</div>
<button type='submit' name="validateBtn" class="upload-photo submit" id="validateBtn">Submit</button>
</form>
I had to get fancy with the styling, which is why you see that div with an id = "ugly".
I would love to get this working with button new and existing images, but nothing I try seems to work.
Any help or ideas is appreciated.
Thanks in advance!
I had a similar issue which has plagued my users since IOS 9 came out. I FINALLY fixed it. Basically, the issue is that Safari Mobile drops the .jpg from the uploaded filename for .jpg media files. Screenshots and current Camera are .pngs, and they get uploaded with an extension, so they work. It's just images you take with the camera and save to the media roll ahead of time that don't have an extension at upload time. Since most server side back end systems check extensions to determine whether the file is an image and should be post-processed, it's most likely that on the server side you are receiving the file, but you are instantly discarding it because it has no extension. Since I couldn't test with a true IOS device against my local dev environment, and ergo, step through the server side code after being submitted by an actual IOS Device (not an emulator), I assumed the same thing, that the input was never getting posted.

Need jsp form to submit query to specific path

I'm trying to setup a simple form in a jsp that will put a search query in the URL submitted.
This is what I have so far:
<form action="search/" method="get" onsubmit="this.action+=this.q.value.trim();return true">
<input type="text" id="q">
<input type="submit" value="go">
</form>
This is in a jsp that's included on each page of my web app and it works when I'm at the root of the app. For example, if I initially load "http://localhost:8080/MyApp/" then type "123456" in the search form, it takes me to "http://localhost:8080/MyApp/search/123456", which is what I want. However, from that page, if I search again (for "654321" for example) it goes to "http://localhost:8080/MyApp/search/search/654321", which doesn't work for me. I need search/{query} to be appended to the root of the app's path no matter what page I may be on at the time.
I would like to avoid javascript if possible, I'm fine with JSTL though.
Any suggestions would be much appreciated!
Simply add a full path to your action, start it with /. Note it will depend on your application context, you could use :
<form action="${pageContext.request.contextPath}/search/"...
It will work in dev and also prod.
EDIT :
Path : search will try to load relative from current path so : http://domain.com/contact/search/
Path : /search will try to load relative from the domain so : http://domain.com/
With the context path above, it will work no matter if it change from dev to prod.
Hope this helps!

Activate a search on another website

I am trying to embed the search forms of two other sites into my own site. Here is my site, the forms are at the bottom: http://dsa.dartmouth.edu/.
The DGD search works fine - the user gets directed to the search results page - but the Course Picker one doesn't - the user just gets redirected to a blank search page.
This is my form code:
<form action="http://coursetown.hacktown.cs.dartmouth.edu/search" method="post" class="appSearch">
<input id="search" name="query[title]" placeholder="course title(s)" type="text" role="textbox">
<input type='submit' name='commit' type="submit" value='Search' />
</form>
Is there a way to make it so that the user gets directed to coursetown's search results page when they click search?
The search form on http://coursetown.hacktown.cs.dartmouth.edu/search submits by AJAX so there is no search URL to hit. Furthermore, it seems to use a hidden "authenticity_token" field, which is probably generated server-side on load so you probably need to find out if they have an API you can use for this.
If you can edit that page directly to trigger the search by JavaScript based on URL parameters that would be an option too, not sure what level of control you have over the search page.

Passing HTML form data in the URL on local machine (file://)

I'm building a small HTML/JS application for primary use on local machine (i.e. everything is accessed via file:// protocol, though maybe in the future it will be hosted on a server within intranet).
I'm trying to make a form with method="get" and action="target.html", in the hope that the browser will put form data in the URL (like, file://<path>/target.html?param1=aaa&param2=bbb). However, it's not happening (target.html opens fine, but no parameters is passed).
What am I doing wrong? Is it possible to use forms over file:// at all? I can always build the url manually (via JS), but being lazy I'd prefer the browser do it for me. ;)
Here is my sample form:
<form name='config' action="test_form.html" method="get" enctype="application/x-www-form-urlencoded">
<input type="text" name="param1">
<input type="text" name="param2">
<input type="submit" value="Go">
</form>
It might be some browser specific restriction. What browser are you using?
I tested this in Firefox 3.6.3 and Internet Explorer 8, and it works just fine.
Ok, that was stupid. The controls of my form are generated dynamically (via JS), and the generation function was setting ids for them, but not names. So, from the form's point of view, there was no parameters at all.
Thanks to Guffa for providing me a nudge in the right direction!