Invalid assignment left hand side

Posted by JoelM on Stack Overflow See other posts from Stack Overflow or by JoelM
Published on 2012-04-03T08:22:52Z Indexed on 2012/04/03 11:29 UTC
Read the original article Hit count: 402

Filed under:
|
|

I'm getting an invalid assignment left hand side.

What I'm trying to do is, to use jscolor http://jscolor.com to define the color of polygons im drawing via Mapbender http://mapbender.org.

What I do: Select a polygon by clicking on it, then open the options dialog (seperate window) where I have several options including the color.

MyCode:

        if (isTransactional) {str += "\t\t<tr>\n";
        var options = ["insert", "update", "delete", "abort", "pick"];
        for (var i = 0 ; i < options.length ; i++) {
            var onClickText = "this.disabled=true;var result = window.opener.formCorrect(document, '"+featureTypeElementFormId+"');";
            onClickText +=  "if (result.isCorrect) {";
            onClickText +=      "window.opener.dbGeom('"+options[i]+"', "+memberIndex+"); ";
//              onClickText +=      "window.close();";
                onClickText +=  "}";
            onClickText +=  "else {";
            onClickText +=      "alert(result.errorMessage);this.disabled=false;"
            onClickText +=  "}";
if (options[i] == "insert" && hasGeometryColumn && (!fid || showSaveButtonForExistingGeometries)) {
                str += "\t\t\t<td><input type='button' name='saveButton' value='"+msgObj.buttonLabelSaveGeometry+"' onclick=\""+onClickText+"\" /></td>\n";
            }
if (!featureTypeMismatch && fid) {
                if (options[i] == "update" && hasGeometryColumn) {
                    str += "\t\t\t<td><input type='button' name='updateButton' value='"+msgObj.buttonLabelUpdateGeometry+"' onclick=\""+onClickText+"\"/></td>\n";
                }
if (options[i] == "delete"){ 
                    var deleteOnClickText = "var deltrans = confirm('"+msgObj.messageConfirmDeleteGeomFromDb+"');";
                    deleteOnClickText += "if (deltrans){";
                    deleteOnClickText += onClickText + "}";
                    str += "\t\t\t<td><input type='button' name='deleteButton' value='"+msgObj.buttonLabelDeleteGeometry+"' onclick=\""+deleteOnClickText+"\"/></td>\n";
                }}
if (options[i] == "abort") {
                str += "\t\t\t<td><input type='button' name='abortButton' value='"+msgObj.buttonLabelAbort+"' onclick=\"window.close();\" /></td>\n";
            }
if (options[i] == "pick") {
                var color;
                str += "<td><input class='color' name='color' id='cPick' onchange="+color+"></td>";
                str += "<td><input type='text' id='text' value="+color+"></td>";
                //color = document.getElementById('cPick').value;
                //var color2 = color;
                //alert(color2);
            }
        }str += "\t\t</tr>\n";}str += "\t</table>\n";str += "<input type='hidden' id='fid' value='"+fid+"'>";
//str += "<input type='text' name='mb_wfs_conf'>";


    str += "</form>\n";}return str;}

The Application:

It is a Mapbender application to display maps and draw on it. You can draw points, lines and polygons also merge and split them. You can also select the polygons that you have drawn to alter them.

Using: PHP, JavaScript, HTML, CSS, Mapbender, jQuery, Geoserver, PostgreSQL, WMS, WFS-T

Sorry guys, but I think I'm wasting your time. Will ask this question in GIS specified Q&A.

Thank you for the input.

Greetings Joël

© Stack Overflow or respective owner

Related posts about field

Related posts about variable-assignment