Hey ta again Nick! That looks very suitable as it needs to be in a separate file for preference.
Update. All working now. Ta again.
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "Another Firefox jscript conversion problem"
Collapse
-
Nope, your example uses IE's databinding stuff, which was only ever a proprietary Microsoft extension.
One possibility would be to convert your CSV file to a JavaScript object or array literal (very similar to JSON, which is what all the other browsers including IE 8 have moved towards), which you could load using <script src="keys.js"></script> where "keys.js" would contain something like:
The variable values can then be iterated over; assuming that the key is the name of the input field and the value is the value of the input field, something like:Code:var values = { "key1": 2, "key2": "Value of key 2", "foo": "bar", "baz": ["array", "of", "strings", "and", 1, "number"] };
(It gets slightly more complicated if you want to set the currently-selected values of things like SELECT elements...)Code:var elements = document.getElementById("myForm").elements; for (var name in values) { if (!!elements[name]) { elements[name].value = values[name]; } }
Leave a comment:
-
Another Firefox jscript conversion problem
In IE I am using a recordset object:-
<OBJECT ID="key_yesno"
CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<PARAM NAME="DataURL" VALUE="keys.csv">
<PARAM NAME="UseHeader" VALUE="True">
<PARAM NAME="TextQualifier" VALUE=",">
</OBJECT>
It allows for a scroll button to read various values from a csv file using key_yesno.recordset.MoveNext() and inserts them into INPUT HTML elements
eg <input type=text DATASRC="#key_yesno" DATAFLD="name0">.
I could just shove the values in hidden HTML elements but before I fanny about doing that is there an equivalent that works in firefox and the other browsers? Can't seem to find one on net.
Cheers for usual brilliant replies.
PS This needs to run on PC not just online.Last edited by xoggoth; 15 September 2009, 11:51.Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers

Leave a comment: