PDA

View Full Version : datafield change !


visual
05-26-2004, 03:46 PM
Hi !

I do have a question !
Jere did wrote a simple Script, that change a HTML code by click !
___________________________________________________________

function changeAction(formId, toWhat){
document.getElementById(formId).action = toWhat;
}
___________________________________________________________

In HTML:
<input type="submit" class="Search" value="X" onclick="changeAction('theForm', '/cgi-bin/del.pl');">
___________________________________________________________

Now, i wanna use this code for that:

... <span id="theForm" datafld="EN"></span></font></td>
</tr></table> ...etc.

___________________________________________________________

I wanna change the datafld="EN" to datafld="FR"
But it doesn't work !

I changed the action, in the script, to datafld.

coothead
05-26-2004, 05:07 PM
Hi there visual,

datafld is case-sensitive and in the script should be...

document.getElementById(formId).dataFld

instead of...

document.getElementById(formId).datafld


Whether this will make it work for you I cannot say...
I believe that datafld is I.E. only ;)

Jon Hanlon
05-26-2004, 06:03 PM
dataFld (http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/datafld.asp) is used (by IE) to bind a field to a Data Source Control.
eg.
<table datasrc="#planets">
<tr><td><input type="textbox" datafld="name"></td></tr>
<tr><td><input type="textbox" datafld="orbit"></td></tr>
...

I'm not too sure you can reassign it dynamically...

but if you could, you'd say:
document.getElementById('theForm').dataFld = "FR"

visual
05-27-2004, 04:22 AM
Hi Coothead , Jon !
Ok ! I change the dataFld.

The reason for that, i wanna change the Language on my Page, by click on a Flag.

___________________________________________________________
So, i think it's better to change this:

<object id="TEXT" classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">

THIS----> <param name="DataURL" value="txt/info.txt">

<param name="UseHeader" value="true">
<param name="FieldDelim" value="|">
</object>
___________________________________________________________
So that i have for each language a own file.
I think this is better.

How can i change this:

<param name="DataURL" value="txt/info-En.txt">
to
<param name="DataURL" value="txt/info-Fr.txt">
___________________________________________________________

And if it's possible, can i let the script do it from a other frame ?