FoxPro Programming
Getting Object Reference with No ID
Gravatar is a globally recognized avatar based on your email address. Getting Object Reference with No ID
  Steve
  All
  Oct 24, 2019 @ 06:45am

Hi All,
I am trying to automate uploading of data to a web page, something I have done a few times in the past. However, the current page I am working with does not utilize an object id. How can I get an object reference to app0_fname below so I can insert a value?

<fieldset class="fieldset-personal-info form-section">
	<div class="section-header">Customer Information</div>
	<div class="flex-row">
		<div class="flex-item">
			<div class='form-group floating-label' style=''><label>First Name</label><div class='input-group '><input type='text' name='app0_fname'  value='' placeholder='First Name' class=' validate required' data-validate='has_value' data-original-value='' /></div></div>
		</div>

TIA,
Steve

Gravatar is a globally recognized avatar based on your email address. re: Getting Object Reference with No ID
  Rick Strahl
  Steve
  Oct 24, 2019 @ 09:44pm

Sorry not sure what you're asking... How are you accessing this HTML? Web Browser control?

In that case you need something like this (not tried):

el = wb.document.documentElement.querySelector('input[name="app_fn0name"]')

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Getting Object Reference with No ID
  Steve
  Rick Strahl
  Oct 25, 2019 @ 09:51am

Yes, I am using the Web Browser Control embedded on a VFP Form. I apologize for not making that clear initially.

The querySelector approach is working!!

Thanks!!!!!

© 1996-2019