Atozed Forums

Full Version: Saving Raw Text with input controls
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.

I am having to make a questionnaire and I was wondering if it was possible by using the RawText to load an html file, the html will have input controls.  

I can get that part to work fine, but what I want to do is save the results and I was hoping I could just do a save to file but that doesn't seem to work, is this possible?  What I am finding is it just saves back the original content, ignoring anything in the input boxes.  It would certainly make this questionnaire a lot easier as it is likely to change often and so simply updating the html and then saving the results would be great.

Is this possible, and if not any other suggestions?

Regards
David.
The problem here is that the controls that you create in your HTML file (e.g input controls) don't have any correspondent class/control on server side. When you change anything on the browser, the server is not notified of those changes (through a request).

Do you have a list of types of controls that you have (e.g. edits, combo boxes, radio buttons, check boxes, etc)?

I believe the best way to do this is via templates. A mix of raw HTML for most of the document + a few IW controls that can be created at runtime...
(02-24-2022, 10:12 AM)Alexandre Machado Wrote: [ -> ]The problem here is that the controls that you create in your HTML file (e.g  input controls) don't have any correspondent class/control on server side. When you change anything on the browser, the server is not notified of those changes (through a request).

Do you have a list of types of controls that you have (e.g. edits, combo boxes, radio buttons, check boxes, etc)?

I believe the best way to do this is via templates. A mix of raw HTML for most of the document + a few IW controls that can be created at runtime...

Hi Alexandre.  Yes this form will be made up mainly of Combo boxes, memos and text boxes.

I have started to use templates and got something working reasonably well, but I then need to find a way to save/reload this data easily.  I can use a database which is probably what I will start off with, but the trouble with this is that if the questionnaire changes frequently, that will make maintaining the database and having to add more fields, obsolete old fields etc a bit of a pain.  That is why I was hoping of an easy way to save the page to file would be possible.

The way I am using the template is to define a page that is part of a master page then just put in place holders in the html file and correspondingly named components on the IW Form.  This allows me to put in some logic like hiding memo boxes unless a Yes is defined in a corresponding combo box.  It works quite well but takes a bit of time to get it all setup.

Any suggestions on saving the template to a blob field in a database or file?

Thanks
David.
Hi there,

sorry for the late response, I missed you answer.
I'll try to get some demo showing how to use templates in a more dynamic way. I think it might be useful in your case.

>That is why I was hoping of an easy way to save the page to file would be possible.

Do you mean at server side or browser side?

I'm assuming you want to load the template from a blob field at runtime before displaying it, is that correct?
(03-16-2022, 08:18 PM)Alexandre Machado Wrote: [ -> ]Hi Alexandre that would be great if you have something that might help.

When I was looking at using blobs, my though was that I could save the page to a blob field and then use this to reload the completed page when required, this would be server side, not client side.

However I have continued with using templates and at the moment I am using a single template that has a number of tables for each questionnaire type and these are collapsed initially, I am then using JavaScript to change the visibility to show/hide which seems to work, but I notice that this all goes to pot if a post is made back to the server, as everything returns to being collapsed again.  I am sure I can get around this, but I am not convinced this is the best way to do this? 

I am going to have around 10 different questionnaires, with roughly 10 questions minimum each, so this could mean I have to define 90 controls on the page that are hidden at any one time.  I also have to have a control for each answer on the form and this is becoming messy on the delph form.

So my template looks something like this.

Table - Collapsed
 Questionnaire A
   {%Q1%}
    {%Q2%}


Table - Collapsed
 Questionnaire B
    {%Q3%}
    {%Q4%}

I also have some sections in the questionnaire where for example I am using Questionnaire B from above, but one of the questions should result in Questionnaire A also being shown,  Again I can get this to work, but due to the way I have defined the page using tables, this would mean that initially you are viewing Questionnaire B, but when Questionnaire A is also required, it appears above Questionnaire B which isn't ideal and i don't know how to get around that using this modal.

I hope that makes sense.  As I said, I am sure there is a better way to do this, just have not figures out what the best way to do it is yet.

Any help gratefully received.

Regards
David.