setFormField() on IE

Hi,

for dynamic handling the formfields, I create the input-field (inpFoo) with default value. Later in the code I have to change the value of this field to ‘bar’.

I find out, in the IE (6) I can’t call the form fields by document.getElementsByName('inpFoo), because the name-Attribut is not supportet by input-fields in IE. So, I have the Problem fixed with add the code field.id = name in dhtmlxvault.js on function setFormField().

Can you change this in the next version?

Thanks for this great work
Dirk

Sorry, we do not use getElementsByName().

That’s right, but the field comes not with a ID … so getElementById(), or Prototypes $() doesn’t work either.

I do not understand the idea, we have both getter and setter for custom filed, please use them.

mpfh … Sorry, I don’t see the getFormField() - method! Forget my post!!!

Hi

ASP.NET C#, Database MS SQL 2008

Table: Upload
Colum: UploadID
Colum: PromoCode
Colum: Filename

First off, the picture gets to be uploaded into the catagory (good)

The Messagebox Alerts an Error: False even due to the upload function is working fine.

Here is where it does not work anymore:

  1. The webpage does not stop Loading after clicked on the Messagebox
  2. The Parameter ‘Promocode’ Does not get to be added into the database

vault.onFileUploaded = function (file) { alert(“id:” + file.id + “,name:” + file.name + “,uploaded:” + file.name+ “,error:” + file.error); };
vault.create(“vault1”);
vault.getFormField(“promocode”, “SITX9”);
vault.setFormField(“uploadID”, null); // will remove this field from the form

UploadHandler.ashx

finally
{

             SqlConnection connection = new SqlConnection("Data Source=localhost;Initial Catalog=xxx; user ID=xxxx; password=xxxxx");
                connection.Open();

                string sqlquery = ("INSERT INTO Upload VALUES('" + context.Request.Form["promocode"] + "','" + context.Request["fileName"] + "')");

                SqlCommand command = new SqlCommand(sqlquery, connection);

                command.ExecuteNonQuery();
                connection.Close();

                CurrentSize = "-1";
                fp.Dispose();
                fp.CloseStreams();
                
            }

Have anyone figure this out yet ?

For Aspx, better to use methods setUploadParam(name, value) and getUploadParams()
and then read them on server side using context.Request.QueryString[“paramName”]