R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Commas and other characters in text input cause problems...
Last Post 01 Jan 1900 05:00 AM by . 31 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Page 2 of 2 << < 12
Author Messages Informative
rickwpUser is Offline
New Member
New Member
Posts:92

--
09 May 2008 03:24 PM  
Well, I would say that times like this when using a variable causes formatting issues, that's a pretty good example of a time when a variable can't be used.

Another example: when you want to have a tabular listing of data, not just one record at a time but all records, you couldn't use a variable then without bypassing Listx altogether for the actual listing and writing the code yourself. If you could present an example of a listing using variables instead of database field names and have it work without problems when the fields contain commas and brackets in the data, and list all records, I'd love to see that so I could learn from it and know exactly how to avoid these problems.


TalalUser is Offline
New Member
New Member
Posts:90

--
09 May 2008 05:12 PM  
Rob; The program i am using (which hopefully will share once working flowlessly with the community is an automated forms.. dynamic forms.

all the fields are defined on a table on the SQL server, field names, data types, field type (drop down list, text, HTML, etc) and the 'engine' takes care of the displaying of the form, editing, adding, validation, etc.

This is working and currently i am using for a project. The only issue I am experiencing is the VARIABLES vs. grabbing the form value by tags (as i mentioned above).

Most of the work is done in the ACTION sections.

IMHO, the developer should not say use this but not this. There will always be a situation where any or both ways are required.

You have the tags for [Value, Form]. Why not make them safe.

If you can add a tag for {SafeForm, ControlName, Options} for example that can safely grab a value from the form that would make life much easier.

"after all, it's my data" <img src='desktopmodules/ntforums/images/emoticons/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'>


robert_chumleyUser is Offline
Advanced Member
Advanced Member
Posts:592

--
09 May 2008 09:42 PM  
Ah Right,
That makes sense. Basically you are concatenating values to product the form values in a dynamic way. Yes, I do this quite often. It is really the only way to get a set of values from a checkbox list. But what I do not exactly understand is what limitation are you having? As you saying there are certain values you cannot concatenate? (pulling directly from fields there is some problems, but lots of them I have been able to deal with by adding specific query string parameters that helps me define exactly what data I am looking at. The User Management LP is a prime example of this technique.

Of course you can always do nested queries. You can have an Action:Excecute then another Action:Execute as a child of that action. The second action will get execute for every parent, and you have access to the values returned from the first query. Is this closer to what you are looking for?

Thanks,


Robert Chumley<br>r2integrated (formally bi4ce)
TalalUser is Offline
New Member
New Member
Posts:90

--
09 May 2008 09:52 PM  
sorry i think the original topic is missed, the problem here is not the excution but rather the assignment of values from the form.

update tbl set fld = '[MyField,form]'

is a no no.

Escape the ' then you will have a problem with comas, \ / or various other chars.


robert_chumleyUser is Offline
Advanced Member
Advanced Member
Posts:592

--
09 May 2008 10:30 PM  
Ok guys, last bit of Friday goodies....
Courtesy of Kevin 'the man' Schreiner. I believe this will solve the problem. This solution will change a bit in OWS, but basically the same concept.

This should take care of the need to escape SQL.

Thanks,

Attachment: dynamicForm.xml

Robert Chumley<br>r2integrated (formally bi4ce)
TalalUser is Offline
New Member
New Member
Posts:90

--
09 May 2008 10:47 PM  
thx Rob, excellent...

do you mind sharing the OWS solution also because i am doing the changes side by side to both as i test OWS.

Thank you guys


TalalUser is Offline
New Member
New Member
Posts:90

--
10 May 2008 03:45 AM  
Robert; I spoke too soon, sorry that did not work..

here is how you can recreate the problem.

in the attached zip file there are 2 files.

1. there is a SQL file that creates a simple tblTest table with 2 fields. Please execute it.
2. you may need to set the permissions to allow UPDATE.
3. insert any record there.. any text
4. use the XML to create a ListX module.

now when you try saving simple text like Hello World it will work.

Then try something with ' and it will fail.


Also; are we saying here that [FormField,form] is not safe? if we always need to use variables
so what is the need for [value,form] tag?

Attachment: Test.zip

jliptakUser is Offline
Basic Member
Basic Member
Posts:162

--
11 May 2008 03:19 AM  
Hi Talal,
I've had a quick look at your test config. There looks to be some problems in it. Here are the changes i made to it & i cant see any problems with special characters;

Change 1
--------
From: If '[frmSubmit]' <> ''
To: If '[frmSubmit,Form]' <> ''

The original statement was referencing a non-existent variable in which case the condition would always resolve to true. This is probably an oversight in the example.

Change 2
--------
Inside the "Query[Test]" uncheck "Run as process".

Whats happening here is that you are creating a new thread and all indented actions will occur in a separate thread. Within this thread you are referencing the form field "[txt[ID,Test],Form]" in an action assignment.

At the same time the original thread is still running and this original thread is responsible for returning all records from the table & rendering these on the form.

With both of these problems, it all got all a bit confusing & i wasnt sure what was going on in such as small listx, but i suspect that some of your problems may be because the update statement was reading the form just before/or after the first thread was rendering the form.

You will probably be better off assigning the Action Variables outside of the Action Query.

In the end though, when i made these changes, i couldnt see any problems with special characters. Are you saying that this listx config was the one that caused special character problems?

Cheers
John Liptak


TalalUser is Offline
New Member
New Member
Posts:90

--
11 May 2008 03:55 AM  
hmmm,
#1 was a typo from 'the man' <img src='desktopmodules/ntforums/images/emoticons/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'>.

I used the same example and modified a bit.\

Although that was not actually the cause because it was ALWAYS be true like you mentioned.

the run as process was not checked.


What values did you test with?

try
hello, my name is<talal> //[{<{}}'.,{\/\/\}[]\\[]]\



jliptakUser is Offline
Basic Member
Basic Member
Posts:162

--
11 May 2008 11:58 AM  
Try this config.

Attachment: testUpdate.xml

TalalUser is Offline
New Member
New Member
Posts:90

--
11 May 2008 09:04 PM  
thx John, that worked, i guess the difference was escaping HTML.

this could be a good work-around for my solution however i would like it even better if Bi4ce finds a better way to [value,Form] so that it can be safe because the work around is not flexible and not obvious to many.


robert_chumleyUser is Offline
Advanced Member
Advanced Member
Posts:592

--
12 May 2008 01:46 PM  
Hello Talal,
In OWS there should be another solution where you can have Variables as children of queries, this will allow you to escape as you go.
Thanks,


Robert Chumley<br>r2integrated (formally bi4ce)
You are not authorized to post a reply.
Page 2 of 2 << < 12


Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share