So basically I need my submit button to create a template site.
I mean totally new file.php with some default CSS styling and values from forms.
The file.php would be created automatically in my web folder when I hit submit button.
I know something like this can be done by loading content from database but that is not what I want.
I am not really sure how to do that. Whatever it takes, I am going to learn that, please help.
Related
I wanted to make specific inputs go into another part of a site (e.g. https://myexamplesite.com/anotherpartofit.html)
And also make those specific inputs be the ones that someone saved it in.
An example of what I think would work is: Get value from input 1 from /apartofit.html and put it in input 2 at /anotherpartofit.html and make it non-editable
If it needs to use a database, I would prefer if you could help me with firebase (Google's Database). But in my knowlege, it probably needs to use javascript, so I'll be tagging it, if it doesn't, let me know!
in visual studio or notepad or every offline web creating spaces you can't but if you buy a domain or simple , online site , you have to crate a page and get the link of that page then open another page create a button set the button's href to link of pervious page finally hit the button !
I'm using CKEditor in a website and I want to use it as editor of the page itself. So the user goes to the page, modifies what he wants in the ckeditor textarea(s) and then he clicks 'save' or 'submit' and the page is modified (that page would be protected by a login, so only certain users could modify).
Problem is I have no idea how to save the content of ckeditor in that same textarea that was modified, I tried looking around but everyone wanted to save data in a DB or send it to some other page.
I found 2 plugins that implement some save function but again, I don't know if I can use those to do what I want. (Save plugin, Inline save.
Hope you understood what I'm asking, thanks in advance.
I'm creating a webform using a marketing automation platform. I want to add a field that functions with jquery to do an autocomplete. Unfortunately, the forms are generated through a WYSIWYG editor in the software, and then generated and put into the page when it renders. The only code for the form that appears in the HTML for the page is a simple variable placeholder - %%FORM::DEFINITION%% - which is then replaced with the form code when you visit the URL. The software support team tells me that making the change I want to make is impossible, which I see as a challenge.
The only thing I need to be able to do is add an id="autocomplete-dynamic" attribute to the input on the form. I had two ideas how I could achieve this.
The first, and most preferable option, would be some script that runs at the bottom of the page that simply inserts the attribute into the input tag after the page renders out. This would only be a client-side change, but since all this does is make the text field capable of looking up values out of another table, it should be fine. If someone had a script blocker in place, they would not be prevented from typing into the text field normally, it's just that the auto-lookup wouldn't work. We're trying to make it easier to select an item from a list of thousands of possibilities, but if someone had to type in their own entry without the autocomplete, it would not be a disaster. This seems like a clean solution, but I am not sure if it can be done.
The other possibility is to get the form code out of the software and embed it in a separate HTML document, and make the change there. You can extract the raw HTML for the form for use on another page, but pasting this code right back into the landing page causes errors. So, the thought then was that if I have taken the code generated by the software and put it in an HTML page on a separate web server, I could modify it as needed, and then turn around and use an iframe to stick it right back in the landing page. The software shouldn't complain because the form is being used on an external site like it's supposed to be... I have just hidden that external site back inside the platform-hosted page.
Option 1 would still be much easier to implement, I think, provided it is actually possible.
Thanks in advance.
Your first solution seems completely appropriate.
$(function() {
$('#myForm input').attr('id', 'autocomplete-dynamic');
});
This can be added anywhere inside a script tag because it's wrapped in a shorthand document.ready function, which waits to run until the DOM is ready.
This is more of an approach issue than how-to.
I have a main form/document where user can dynamicaly attach/upload files using hidden iframe.
Each time user removes/adds a file, it is deleted/persisted to database by submitting an extra form to iframe. After that I do an ajax call and render a new gsp template containg updated list of files. All without page reload.
Then, if the form is successfully saved and validated, the uploaded files are linked to it. If not, they get eventualy cleaned up sometime later.
I am quite satisfied with the result but..
What I would like to know is if this is a good approach, since I always render a new template instead of DOM manipulation with javascript to provide the user the dynamic feel of file handling. Which I have seen most people do.
The one thing I can't seem to figure out is how to "localy" (hide it from user) remove the file without deleting it from database(without DOM). Atm, if the user deletes a file but decides not to save the main form, the file is gone anyway.
Thanks
I'm not entirely sure I understand the last part of your question, but I'm going to take a stab at it anyway. My assumption if that a user can say they want to delete a file, but not save the form, thus, the file doesn't get deleted. But when this happens, you're removing the file from the list anyway, and then it comes back on a page refresh.
If this is the correct understanding, I would recommend styling the representation of the file in some way that would indicate it is ready for deletion. Don't remove it completely. Gray it out, strikethrough, add an icon, something that says the system will delete this when you hit save.
I'm building a site in CakePHP, and I'd like to give a 'Preview' option for pages as they're being added or edited.
In the 'Add Page' view, for instance, I have the usual form which the user uses to create their page. There is a 'Save' button, to save the data. Next to that, I'd like to have a 'Preview' button, which opens the page in a new window.
So, either I need the controller to open a new window (and I don't think this is possible), or it needs to be a link (targetting a new window) instead of a button - but in that case, how do I POST the data so that it can be shown? Do I need to use ajax or something? I'm a total newbie in ajax, but I do have a reasonable grasp of javascript.
Thanks for any help!
If the data that you are previewing is already saved on your database, then you can have an action in your controller (maybe preview()) action that references the saved data and loads the preview. And then to use it, you can just use a regular link that targets a new page and opens it there.
This would require saving the data the user is typing to your server every few seconds, though.
If you want to use the data that is still on the page, then you can use a JavaScript function to load a lightbox and populate the contents of that lightbox with data from the fields that the user is working on. You can probably use fancybox for that.