URGENT help needed

View: New views
3 Messages — Rating Filter:   Alert me  

URGENT help needed

by erik tom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can anybody help me construct the string Because it does not insert into DB
function preprocessAll(obj)
{
        switch(obj.id)
    {
       
                case "btnAdd":
               
                         var poststr="";
                          poststr += obj.id + "=" + encodeURI(obj.value);
                        poststr += "&";
                        poststr += "topLevel=" + encodeURI(document.getElementById("topLevel").value);
                        poststr += "&";
                       
                        //poststr += "foundOn=" + encodeURI(document.getElementById("foundOn").value);
                        for (var i=0; i < document.getElementById("foundOn").options.length; i++) {
                        if (document.getElementById("foundOn").options[i].selected) {
                                poststr += document.getElementById("foundOn").options[i].value ;
                        }
                }
  if (poststr.length > 0) {
                        poststr = poststr.substring(0, poststr.length-1);
                }

                        poststr += "&";
                        poststr += "txtAreaDesc=" + encodeURI(document.getElementById("txtAreaDesc").value);
                                poststr += "&";
                        poststr += "link=" + encodeURI(document.getElementById("link").value);
               
                        makeRequestAll('insertIntoMenu.cfm', poststr);

         break;
                }
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: http://www.houseoffusion.com/groups/Ajax/message.cfm/messageid:5009
Subscription: http://www.houseoffusion.com/groups/Ajax/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.47

Re: URGENT help needed

by Todd Kingham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tom,

It looks like you are trying to convert a Form into a QueryString so you
can pass it in. You should try downloading JSMX at
http://www.lalabird.com. It allows you to just pass the entire form into
the request and it does the rest. Even if you do not wish to use JSMX
for your Ajax call you can still open up the engine.js file and grab a
function called _form2queryString(). That is what JSMX uses to convert
the entire form into the query string and you can use that.

erik tom wrote:

> Can anybody help me construct the string Because it does not insert into DB
> function preprocessAll(obj)
> {
>         switch(obj.id)
>     {
>        
> case "btnAdd":
>
> var poststr="";
>  poststr += obj.id + "=" + encodeURI(obj.value);
> poststr += "&";
> poststr += "topLevel=" + encodeURI(document.getElementById("topLevel").value);
> poststr += "&";
>
> //poststr += "foundOn=" + encodeURI(document.getElementById("foundOn").value);
> for (var i=0; i < document.getElementById("foundOn").options.length; i++) {
> if (document.getElementById("foundOn").options[i].selected) {
> poststr += document.getElementById("foundOn").options[i].value ;
> }
> }
>   if (poststr.length > 0) {
> poststr = poststr.substring(0, poststr.length-1);
> }
>
> poststr += "&";
> poststr += "txtAreaDesc=" + encodeURI(document.getElementById("txtAreaDesc").value);
> poststr += "&";
> poststr += "link=" + encodeURI(document.getElementById("link").value);
>
> makeRequestAll('insertIntoMenu.cfm', poststr);
>
>          break;
> }
> }
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: http://www.houseoffusion.com/groups/Ajax/message.cfm/messageid:5012
Subscription: http://www.houseoffusion.com/groups/Ajax/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.47

RE: URGENT help needed

by Andrew Scott-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Although there is not enough information on your problem, can I give you
some advice.

Go to http://getfirebug.com/

Download and install this plugin for firefox, then switch it on for the site
you want to delve deeper into. This will allow you to see what is being
returned from the browser, if you are using ajax calls, it will also show
the call to the server and what is returned by the server.

I can't stress enough how important that tool is for developers debugging
applications.

I only wish that more people know about it:-)



--
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 9015 8628
Mobile: 0404 998 273




-----Original Message-----
From: erik tom [mailto:erik.tsomik@...]
Sent: Friday, 22 February 2008 6:14 AM
To: Ajax
Subject: URGENT help needed

Can anybody help me construct the string Because it does not insert into DB
function preprocessAll(obj)
{
        switch(obj.id)
    {
       
                case "btnAdd":
               
                         var poststr="";
                          poststr += obj.id + "=" + encodeURI(obj.value);
                        poststr += "&";
                        poststr += "topLevel=" +
encodeURI(document.getElementById("topLevel").value);
                        poststr += "&";
                       
                        //poststr += "foundOn=" +
encodeURI(document.getElementById("foundOn").value);
                        for (var i=0; i <
document.getElementById("foundOn").options.length; i++) {
                        if
(document.getElementById("foundOn").options[i].selected) {
                                poststr +=
document.getElementById("foundOn").options[i].value ;
                        }
                }
  if (poststr.length > 0) {
                        poststr = poststr.substring(0, poststr.length-1);
                }

                        poststr += "&";
                        poststr += "txtAreaDesc=" +
encodeURI(document.getElementById("txtAreaDesc").value);
                                poststr += "&";
                        poststr += "link=" +
encodeURI(document.getElementById("link").value);
               
                        makeRequestAll('insertIntoMenu.cfm', poststr);

         break;
                }
}



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: http://www.houseoffusion.com/groups/Ajax/message.cfm/messageid:5461
Subscription: http://www.houseoffusion.com/groups/Ajax/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.47