Excel VBA to change dropdown menu within a form - vba

I tried some alternatives, but with no success, to change the combobox you can find the website code below (It looks that the problem is that the combobox is inside a form - I can't change an input box as well):
<form action="procRelLmPorData.asp" method="post" target="ifrmGerar" id="frmGerar" name="frmGerar">
<input type="hidden" name="ordem" id="ordem" value="" />
<table style="width:100%;" cellpadding="0" cellspacing="0">
<tr>
<th class="header">Licenças Médicas por Data</th>
</tr>
</table>
<table style="border-bottom:#048282 thin solid;width:100%;">
<tr>
<td style="width:20%;vertical-align:top;">
<table>
<tr>
<td>Regional: </td>
<td>
<select style="width:200px" name="regional" id="regional" onchange="comboFilial(this.value);comboSetor('');">
<option value="">Selecione</option>
<option value='67'>RJ</option>
</select>
I've tried the codes below to solve it:
Assuming that objie = InternetExplorer.Application
1st -
objie.Document.forms("frmGerar").getElementsByTagName("select")("regional").Value = 67
2nd - objie.Document.forms("frmGerar").Item("regional").Value = 67
3rd - objie.Document.getElementById("regional").selectedindex= 2
Can you figure what's the problem?
EDIT
I've found that the form is inside an IFrame, you can find the code below:
<iframe name="ifrmCentro" id="ifrmCentro" src="mapPath.asp?codMenu=404" frameborder="0" style="border: 0px currentColor; border-image: none; width: 100%; height: 177px; display: block;"></iframe>

I made it.
The problem was the iFrame, which I had to navigate through.
.Navigate Website & "mapPath.asp?codMenu=404"
Do While .Busy Or .ReadyState <> 4
DoEvents
Loop
After that I could fill the boxes and select combobox:
.Document.all("datInicial").Value = Range("A6").Text
.Document.all("datFinal").Value = Range("A7").Text
.Document.all("regional").Value = 67
Thanks!

Related

How to click on the element with text as SRP Banner as per the html through Selenium and VBA?

I am trying to click on href using selenium vba in webpage but i am getting below error message.
below is the code which i have tried.
Sub test()
Dim Driver As New Selenium.FirefoxDriver
Driver.Get "http://sums.99acres.com/sums/?profilename=sums"
Driver.FindElementByName("userlogin") _
.SendKeys("xyz") _
.Submit
Driver.FindElementByName("password") _
.SendKeys("12345") _
.Submit
Driver.Get "http://sums.99acres.com/sums/getmyproducts.php?trans_id=1819-T0639786"
Driver.Wait 5000
Driver.FindElementByXPath("//a[contains(#class,'navlink')][contains(text(),'SRP Banner')]").Click
End Sub
I have also tried
Driver.FindElementByLinkText("SRP Banner").Click
Below is the error message i have received
Below is the screen shot where i want to click
Below is the html code.
<frame src="http://sums.99acres.com/sums/products_offered.php?cid=547e14073e8fca793e4629a2acca12c5Si13489029+1534998765+1534998792&trans_id=1819-T0639786" name="left" frameborder="1">
<html><head><script type="text/javascript" src="https://bam.nr-data.net/1/1621b6db8b?a=103016861&v=1071.385e752&to=NV1TZkBVXBdVWk1RVgwXZEBbG0ERWUoWSEsNXERRRkdtC1JfXEpcBhZBWkI%3D&rst=847&ref=http://sums.99acres.com/sums/products_offered.php&ap=736&be=817&fe=840&dc=839&perf=%7B%22timing%22:%7B%22of%22:1534998816389,%22n%22:0,%22f%22:0,%22dn%22:0,%22dne%22:0,%22c%22:0,%22ce%22:0,%22rq%22:13,%22rp%22:798,%22rpe%22:801,%22dl%22:803,%22di%22:838,%22ds%22:838,%22de%22:839,%22dc%22:839,%22l%22:839,%22le%22:840%7D,%22navigation%22:%7B%7D%7D&at=GRpQEAhPTxk%3D&jsonp=NREUM.setToken"></script><script src="https://js-agent.newrelic.com/nr-1071.min.js"></script><script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,t,n){function r(n){if(!t[n]){var o=t[n]={exports:{}};e[n][0].call(o.exports,function(t){var o=e[n][1][t];return r(o||t)},o,o.exports)}return t[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(e,t,n){function r(){}function o(e,t,n){return function(){return i(e,[f.now()].concat(u(arguments)),t?null:this,n),t?void 0:this}}var i=e("handle"),a=e(2),u=e(3),c=e("ee").get("tracer"),f=e("loader"),s=NREUM;"undefined"==typeof window.newrelic&&(newrelic=s);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],d="api-",l=d+"ixn-";a(p,function(e,t){s[t]=o(d+t,!0,"api")}),s.addPageAction=o(d+"addPageAction",!0),s.setCurrentRouteName=o(d+"routeName",!0),t.exports=newrelic,s.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(e,t){var n={},r=this,o="function"==typeof t;return i(l+"tracer",[f.now(),e,n],r),function(){if(c.emit((o?"":"no-")+"fn-start",[f.now(),r,o],n),o)try{return t.apply(this,arguments)}catch(e){throw c.emit("fn-err",[arguments,this,e],n),e}finally{c.emit("fn-end",[f.now()],n)}}}};a("setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(e,t){m[t]=o(l+t)}),newrelic.noticeError=function(e){"string"==typeof e&&(e=new Error(e)),i("err",[e,f.now()])}},{}],2:[function(e,t,n){function r(e,t){var n=[],r="",i=0;for(r in e)o.call(e,r)&&(n[i]=t(r,e[r]),i+=1);return n}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],3:[function(e,t,n){function r(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,o=n-t||0,i=Array(o<0?0:o);++r<o;)i[r]=e[t+r];return i}t.exports=r},{}],4:[function(e,t,n){t.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(e,t,n){function r(){}function o(e){function t(e){return e&&e instanceof r?e:e?c(e,u,i):i()}function n(n,r,o,i){if(!d.aborted||i){e&&e(n,r,o);for(var a=t(o),u=m(n),c=u.length,f=0;f<c;f++)u[f].apply(a,r);var p=s[y[n]];return p&&p.push([b,n,r,a]),a}}function l(e,t){v[e]=m(e).concat(t)}function m(e){return v[e]||[]}function w(e){return p[e]=p[e]||o(n)}function g(e,t){f(e,function(e,n){t=t||"feature",y[n]=t,t in s||(s[t]=[])})}var v={},y={},b={on:l,emit:n,get:w,listeners:m,context:t,buffer:g,abort:a,aborted:!1};return b}function i(){return new r}function a(){(s.api||s.feature)&&(d.aborted=!0,s=d.backlog={})}var u="nr#context",c=e("gos"),f=e(2),s={},p={},d=t.exports=o();d.backlog=s},{}],gos:[function(e,t,n){function r(e,t,n){if(o.call(e,t))return e[t];var r=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return e[t]=r,r}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],handle:[function(e,t,n){function r(e,t,n,r){o.buffer([e],r),o.emit(e,t,n)}var o=e("ee").get("handle");t.exports=r,r.ee=o},{}],id:[function(e,t,n){function r(e){var t=typeof e;return!e||"object"!==t&&"function"!==t?-1:e===window?0:a(e,i,function(){return o++})}var o=1,i="nr#id",a=e("gos");t.exports=r},{}],loader:[function(e,t,n){function r(){if(!x++){var e=h.info=NREUM.info,t=d.getElementsByTagName("script")[0];if(setTimeout(s.abort,3e4),!(e&&e.licenseKey&&e.applicationID&&t))return s.abort();f(y,function(t,n){e[t]||(e[t]=n)}),c("mark",["onload",a()+h.offset],null,"api");var n=d.createElement("script");n.src="https://"+e.agent,t.parentNode.insertBefore(n,t)}}function o(){"complete"===d.readyState&&i()}function i(){c("mark",["domContent",a()+h.offset],null,"api")}function a(){return E.exists&&performance.now?Math.round(performance.now()):(u=Math.max((new Date).getTime(),u))-h.offset}var u=(new Date).getTime(),c=e("handle"),f=e(2),s=e("ee"),p=window,d=p.document,l="addEventListener",m="attachEvent",w=p.XMLHttpRequest,g=w&&w.prototype;NREUM.o={ST:setTimeout,SI:p.setImmediate,CT:clearTimeout,XHR:w,REQ:p.Request,EV:p.Event,PR:p.Promise,MO:p.MutationObserver};var v=""+location,y={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-1071.min.js"},b=w&&g&&g[l]&&!/CriOS/.test(navigator.userAgent),h=t.exports={offset:u,now:a,origin:v,features:{},xhrWrappable:b};e(1),d[l]?(d[l]("DOMContentLoaded",i,!1),p[l]("load",r,!1)):(d[m]("onreadystatechange",o),p[m]("onload",r)),c("mark",["firstbyte",u],null,"api");var x=0,E=e(4)},{}]},{},["loader"]);</script>
<title>SUMS : MAINPAGE</title>
<style>
a:link, a:visited, a:active{color:#0000ff;}
</style>
</head>
<body style="font-family:verdana, Helvetica, sans-serif;color:#000;font-size:11px;">
<br><br><br>
<table width="80%" align="center" style="font-family:verdana, Helvetica, sans-serif;color:#000;font-size:11px;">
<tbody><tr><td>
<table width="100%" aligh="center"><tbody><tr align="center">
<td width="25%" style="color:#9400D3;font-size:14px;text-decoration:underline;">SUMS</td>
<td width="25%" style="color:#9400D3;font-size:14px;text-decoration:underline;">CRM</td>
<td width="25%" style="color:#9400D3;font-size:14px;text-decoration:underline;">Mis</td>
<td width="25%" style="color:#9400D3;font-size:14px;text-decoration:underline;"><!--a href="../sums/logout.php?name=vishal&cid=547e14073e8fca793e4629a2acca12c5Si13489029+1534998765+1534998807" -->Logout</td>
</tr></tbody></table><br>
</td></tr></tbody></table>
<br><br><table width="300" border="0" cellspacing="2" cellpadding="2" style="font-family:verdana, Helvetica, sans-serif;color:#000;font-size:11px;">
<tbody><tr> <td colspan="2" style="color:#ff6600;font-weight:bold;font-size:18px;">PRODUCTS OFFERED</td></tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="19">1.</td>
<td width="374"><span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"><b><a target="right" href="http://sums.99acres.com/sums/zedo_srp_products.php?module=SUMS&trans_id=1819-T0639786&productType=SRPB&prod=SRPB" class="navlink">SRP Banner </a></b> <span style="COLOR: gray"> (Pending: 1 of 1)</span></span></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</tbody></table>
<br><br>
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","licenseKey":"1621b6db8b","applicationID":"103016861","transactionName":"NV1TZkBVXBdVWk1RVgwXZEBbG0ERWUoWSEsNXERRRkdtC1JfXEpcBhZBWkI=","queueTime":0,"applicationTime":736,"atts":"GRpQEAhPTxk=","errorBeacon":"bam.nr-data.net","agent":""}</script>
</body></html>
As per the HTML you have shared to click on the desired element first you need to Switch To the Frame then lookout for the element and you can use the following solution:
Driver.Get "http://sums.99acres.com/sums/getmyproducts.php?trans_id=1819-T0639786"
Driver.Wait 5000
Driver.SwitchToFrame.FindElementByXPath("//frame[#name='left' and contains(#src,'http://sums.99acres.com/sums/products_offered.php')]", timeout:=10000)
Driver.Wait 3000
Driver.FindElementByXPath("//a[#class='navlink' and contains(#href,'http://sums.99acres.com/sums/zedo_srp_products.php?module')][contains(.,'SRP Banner')]").Click
This is too long to fit as a comment legibly. Can you try chucking the pageSource HTML into an HTMLDocument and clicking from there? Following code lines go in continuing from the Wait line you already have, reproduced below:
Driver.Wait 5000
Dim html As New HTMLDocument, ele As Object
html.body.innerHTML = Driver.PageSource
Set ele = html.getElementsByTagName("form")(0)
ele.querySelector("a[href*='trans_id=1819']").Click
I have left it in several stages so you can debug whether the ele is even set before attempting a click.

VBA to click on a button in IE with no ID, Name, ClassName

I need to click on a button in IE. I tried few options with no success. Everything i tried are using TagName/ ClassName/ Name/ ID. But I don't find any of these in the below.
<FORM method=post name=frmSearch action=searchResultsSummary>
<INPUT type=hidden value=GMT+01:00 name=clitz>
<DIV style="MARGIN-LEFT: 30px">
<DIV style="MARGIN-BOTTOM: 10px; FONT-WEIGHT: bold">Common Criteria</DIV>
<TABLE style="MARGIN-LEFT: 20px" cellSpacing=5 cellPadding=0 border=0>
<TBODY>
<TR>
<TD id=oDocumentCategoryCell style="HEIGHT: 22px" colSpan=3 noWrap>Document category:</TD>
<TD colSpan=3 align=left>
<SELECT style="DISPLAY: block" name=docCategory old_value="2">
<OPTION value=%>Any Category</OPTION>
<OPTION value=FINANCE>Finance Document</OPTION>
<OPTION selected value=INBOUND>Inbound Document</OPTION>
<OPTION value=PROCESS>Internal Process</OPTION>
<OPTION value=OUTBOUND>Outbound Document</OPTION>
</SELECT>
</TD>
<TD style="WIDTH: 15px"></TD>
<TD>
<INPUT onclick="javascript:if (!validateSearchForm()) return;if (!checkCountOfDays()) return; addRefKeysToForm(frmSearch); frmSearch.submit();" style="WIDTH: 100px" type=button value=Search>
</TD></TR>
<TR>
<TD style="HEIGHT: 22px" colSpan=3 noWrap>Document type:</TD>
<TD colSpan=3 align=left>
<SELECT style="DISPLAY: block" name=docType old_value="0">
<OPTION selected value=%>Any Type</OPTION>
<OPTION value=CSN_ORD_VALID>CSN Order Validation</OPTION>
<OPTION value=CREDIT_ORD>Credit Order</OPTION>
<OPTION value=EOI_ORDCPY>EOI Order Copy</OPTION>
<OPTION value=LEASE_ORD>Lease Order</OPTION>
<OPTION value=ORDER_REPORT>Order Load Report</OPTION>
<OPTION value=TRADE_ORD>Trade Order</OPTION>
<OPTION value=WATSON>WATSON Quote</OPTION>
<OPTION value=WATSON_UPDATE>WATSON Update Quote</OPTION>
<OPTION value=WNGQ>WNGQ Request</OPTION></SELECT> </TD></TR>
<TR>
I tried going by input tags and it is not working.
I used the below code. It clicks on the button i want but it is not considering the values i gave before clicking on submit button.
Dim btnInput As MSHTML.HTMLInputElement
Dim frm As MSHTML.IHTMLElementCollection
Application.ScreenUpdating = True
Set frm = ie.Document.getElementsByName("frmSearch")
For Each btnInput In frm
If btnInput.Value = "frmSearch.submit()" Then
btnInput.submit
Exit For
End If
Next btnInput
Can some one help me on how to click on the button.
As #Tim Williams suggest, this should work document.querySelector("input[value=Search]").
If this still doesn't return the correct input element then the selector can be made more specific according to the DOM tree where the searched input is located, e.g. like this.
' Add reference to Microsoft Internet Controls (SHDocVw)
' Add reference to Microsoft HTML Object Library
Dim inputElement As HTMLInputElement
Set inputElement = doc.querySelector( _
"div[class=main] div[id=inner] table input[type=button][value=Search]")
If Not inputElement Is Nothing Then
inputElement.Click
End If
HTML
<div class="main">
<div id="inner">
<table>
<tbody>
<tr>
<td>
<INPUT onclick="alert('This is the corect one');"
style="WIDTH: 100px"
type=button
value=Search>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<INPUT onclick="alert('No this is not the searched one');"
style="WIDTH: 100px"
type=button
value=Search>
EDIT:
Not sure if I understand your problem correctly.
To select the INPUT element this selector can be used:
Set inputElement = doc.querySelector( _
"form[name=frmSearch] table tbody tr td input[type=button][value=Search]")
To set the value attribute setAttribute() function can be used. To check value attribute getAttribute() function can be used.
If Not inputElement Is Nothing Then
inputElement.setAttribute "value", "some-new-value"
If inputElement.getAttribute("value") = "some-new-value" Then
inputElement.Click
End If
End If

PHP selenium find parent sibiling

I have below code and I want find second td value. How can I select text with <br/> in it?
<tr>
<td valign="top" style="width: 85px">
<span class="fieldtext">Address:</span>
</td>
<td valign="top">
Shaftesbury House, 1st floor
<br/>20 Tylney Road
<br/>Bromley
<br/>Greater London
<br/>BR1 2RL
<br/>United Kingdom
<br/>
</td>
<td style="width: 200px; vertical-align: top; text-align: right;" rowspan="2" />
</tr>
Assuming you want to find the td element by the Address: label defined previously, you can use the following-sibling axis:
//td[span = 'Address:']/following-sibling::td
Then, after locating the element, call getText() method:
$driver->findElement(WebDriverBy::xpath("//td[span = 'Address:']/following-sibling::td"))->getText();
Try as below :-
$driver->findElement(WebDriverBy::xpath('//tr/td[2]'))->getText();
Hope it helps....:)

How to click a link by text in Selenium web driver java

I have many links in my page.One with text "Add policyhoder" ,one with text " Add" only and another "Add PP". I need to click link by text .I am using below code to click link having text as "Add" only but it is clicking very first link having "Add" in its text i.e. ""Add PP" available on screen.Please can u help
Driver.findElement(By.linkText("Add"));
My requirement is to click a link with exact text match . for example "Add" here
<td width="100%" colspan="7">
<table width="100%" cellspacing="0" cellpadding="1" valign="bottom">
<input id="hidPoClaim" type="hidden" onblur="ResetScript(this);" onfocus="HighlightScript(this);" value=" PolicySummary " callfunction="" size="" name="/Root/ACORD/InsuranceSvcRs/com.c_HomePolicyInquiryRs/co.cc_AvailableFunctions[com._FunctionName='PoSummary' and com.csc_FunctionName[#Action='ShowPolicyClaims']]">
<tbody>
<tr>
<td width="25%" valign="bottom" colspan="1">
<strong>
<font class="flabel">Policy Claims History:</font>
</strong>
</td>
<td width="20%" valign="bottom" colspan="1">
<font class="flabel"> </font>
<a class="fLabel" onclick="INFCaptureControlID(this); DoLink('POLICYLOSS','','ADD' );return false; " onblur="ResetScript(this);return true;" onfocus="HighlightScript(this);" delimiter="|" screenaction="ADD" href="" screen="Y" objecttype="POLICYLOSS" type="Link" context="Screen">**Add**</a>
</td>
<td width="20%" valign="bottom" colspan="1">
<td align="Center" width="15%" valign="bottom" colspan="1">
<td width="20%" colspan="1">
</tr>
</tbody>
</table
Thanks
Dev
If it the there are 2 elements with the word "Add", Then try something like this:
List<WebElement> list = driver.findElements(By.linkText("Add"));
list.get(1).click();
To find the element by searching for the exact text, then using xpath will be more helpful.
// For "Add" link, according to the HTML you've added to the question
driver.findElement(By.xpath("//a[text()='**Add**']")).click();
I assume because when you click on first link it opens that link page in same tab and can not find second link element as page changed , so you have to open that link page in new tab in.
I think your code would be :
String Newtab = Keys.chord(Keys.CONTROL,Keys.RETURN);
driver.findElement(By.linkText("Add policyhoder")).sendKeys(Newtab);
driver.findElement(By.linkText("Add")).click();
Now above code will work for you.
you can try using
driver.findElement(By.xpath("//a[text()='Add']"));
This would match exact text for you

Can't seem to figure out why the InnerHTML statements are not working

I have been using a javascript editor and it works fine in it's built-in browser but when I try it in IE and Firefox it loads but then doesn't function.
The HTML is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<noscript>
<p>This page requires JavaScript. Please turn on JavaScript if your browser supports it and reload the page.</p>
</noscript>
<script type = "text/javascript" src="jscripts/pvar.js">
</script>
<title></title>
</head>
<body>
<form name="form1">
Version 2012.10.1.1a
<h2>
Panasas Sizing Form
</h2>
<br>
<table colspan='3' border='0'>
<tr>
<td align="left"> <input type="text" name="textq1" id="dtextq1" readonly="readonly" value="How will this be sized?" style="border: 0"/>
<select name="question1" id="dquestion1" value="" onfocus="this.style.background='khaki'" onblur="this.style.background='white'" onchange="setOptions1(document.form1.question1.options[document.form1.question1.selectedIndex].value)">
<Option value=""></option>
<Option value="Capacity">Capacity</option>
<Option value="Bandwidth">Bandwidth</option>
<Option value="Both">Both</option>
</select></td>
<tr>
<td align="left" id="q1c1"> </td>
<tr>
<td align="left" id="q2c1"> </td>
<tr>
<td align="left" id="q3c1"> </td>
<tr>
<td align="left" id="q4c1"> </td>
<tr>
<td align="left" id="q5c1"> </td>
<tr>
<td align="left" id="q6c1"> </td>
<tr>
<td align="left" id="q7c1"> </td>
</table>
</form>
</body>
</html>
The Javascript is as follows:
function setOptions1(chosen)
{
var label=document.getElementById;
var textbox1="";
var textbox2="";
if (chosen == "") {
label('q1c1').innerHTML="";
label('q2c1').innerHTML="";
label('q3c1').innerHTML="";
label('q4c1').innerHTML="";
label('q5c1').innerHTML="";
label('q6c1').innerHTML="";
label('q7c1').innerHTML="";
}
if (chosen == "Capacity") {
label('q1c1').innerHTML="How much capacity do you require?";
label('q1c1').appendChild(document.createTextNode(' '));
textbox1 = document.createElement('INPUT');
textbox1.type = 'text';
textbox1.value = 0;
textbox1.size = 2;
textbox1.maxLength = 4;
label('q1c1').appendChild(textbox1);
label('q1c1').appendChild(document.createTextNode(' '));
textbox2 = document.createElement('SELECT');
textbox2_option = document.createElement('option');
textbox2_option= new Option ('GB',1,true,false);
textbox2_option= new Option ('GiB',2,false,false);
textbox2.add(textbox2_option);
label('q1c1').appendChild(textbox2);
label('q2c1').innerHTML="Average File Size:";
label('q3c1').innerHTML="Network efficiency:";
label('q4c1').innerHTML="What price level?";
label('q5c1').innerHTML="Would you like to include an IB Router?";
label('q6c1').innerHTML="";
label('q7c1').innerHTML="";
}
if (chosen == "Bandwidth") {
label('q1c1').innerHTML="What are the bandwidth requirements?";
label('q2c1').innerHTML="Network efficiency:";
label('q3c1').innerHTML="Average File Size:";
label('q4c1').innerHTML="What price level?";
label('q5c1').innerHTML="Would you like to include an IB Router?";
label('q6c1').innerHTML="";
label('q7c1').innerHTML="";
}
if (chosen == "Both") {
label('q1c1').innerHTML="How much capacity do you require?";
label('q2c1').innerHTML="Average File Size:";
label('q3c1').innerHTML="What are the bandwidth requirements?";
label('q4c1').innerHTML="Network efficiency:";
label('q5c1').innerHTML="What price level?";
label('q6c1').innerHTML="Would you like to include an IB Router?";
label('q7c1').innerHTML="";
}
}//end function
The problem is this line:
var label=document.getElementById;
Replace it with
function label(s) {
return document.getElementById(s);
}
Host objects are picky -- they don't always like to be treated like regular function references.
BTW: I cut-and-pasted your code into a file than ran it through Google Chrome. The error message was an invalid invocation which let me down replacing the definition of label as my first debugging step.