I wanted to modify the expiration date settings in the form hosted by Authorize.net's CIM API.
I wanted it to be displayed in 2 drop downs, one for month and the other for year, instead of a single text field (mm/yy).
Is it possible to modify the form fields in the form?
Can anyone help me in getting this done.
Thanks in advance.
It is not possible to modify the hosted payment form as you describe.
Related
I have been working around this problem. I have a user submitting a HTML form lets say to list their hotel on my website. I need to review this form before i add it into my hotels model to be published.
One approach i have worked on is to use a requests model where this form can be stored and later using django admin action write a custom action to add/remove the request. In case of acceptance i copy the details to my hotels model else it sends an email or a notification back to user.
Second approach is simply using django action on hotels model where the request is sent to approve it or reject it. In this case i want to know if thats possible where a data point doesn't get written to database until it's been accepted by admin. If yes how can i do that?
Finally, these details are displayed on my main page and search page for users to book these places.
If there is a better and effective way to do it. Please share that.
Thanks in advance. If something isn't clear i can answer your specific questions in the comments below đ.
Have a nice day.
You can have is_published Boolean field in your hotel model and you can default it to false initially. After you inspect the hotel details you can set the is_published field to True from django admin.
So now whenever you are querying for hotels to show on your website. You can query
Hotel.objects.filter(is_published=True)
I have a ModelChoiceField in my form:
customer = forms.ModelChoiceField(Customer.objects.all())
the problem is it renders as a drop down with hundreds of options and its difficult for users to find a customer, is there a way to overcome this???
You should use Bootstrap Select - which is a JQuery plugin that allows the searching of dropdown data by setting data-live-search="true" on the desired field.
You can also set data-size="5" which would only show the first 5 options in the immediate dropdown field, other items are accessed via scrolling.
(This will not help if the problem is the time it takes for this dropdown to load).
This is incorrect way to do what you're trying to accomplish here.
If you're displaying more than 20 or so customer then the UI would clutter and it would be hard to find the customer with ChoiceField. You'd probably want to index the data from your DB into a full text search engine such as ElasticSearch which is based on Lucene and then use AJAX to query particular customer by it's name or any unique identifier.
Needless to say here that instead of the ChoiceField, now your form will have a text field and as soon as user tries to fill in the name, the AJAX calls fetches the customers from ElasticSearch and renders the result.
For a webshop i'm using Sitecore Webforms For Marketers. There is a multiple server configuration with 2 Content Delivery Server(CDS) and 1 Content Management Server(CMS). On the CDS servers is no possibility to write data, so i have configured a webservice to forward the form data from the CDS to the CMS server.
What's the goal? There are 2 forms where a user can:
Post a review for a product at the products detail page
Post a review for a product and select the product in a dropdownlist at a global
page
The problem is that i have less experience with Sitecore Webforms For Marketers. It's important that the review's parent item the right product is. I have read the developer manual and figured out there are several save actions, but not the one i prefer. Do I need to create a custom save action or is there a simple workaroud (e.g. with workflows)?
Thanks a lot!
Jordy
Create a save action that calls your web service and submits the data to your CM instance.
How I can go about adding multiple objects from a single form with Django?
For example: if I have a sales form which stores sold products' register.
Imagine the form:
datetime: [_____________]
customer: [_____________]
product: [______________] ---> How should I implement adding multiple products
in the same form?
cost: [_________________]
Save (button)
Hint: it is just a question, if you have some ideas tell me please because I don't know how to do it.
thanks
One way is to use a Formset. Formsets you may have seen, for example, in Django admin for displaying multiple related objects as inlines.
Another way could involve AJAX, example solution:
âAdded productsâ is a simple <ul> list with products added to order
âSearch productâ is a plain text field, where user enters product name or SKU
User input is sent via AJAX to the server, which returns a list of relevant products
These product suggestions are displayed to user
When user clicks on a product name, another AJAX request is made to associate given product with the order
After request completes, the âAdded productsâ list is refreshed via AJAX, and newly added product appears there
This would require that you first create a temporary order to which you could later attach products via separate requests. Formsets don't have this requirement, but personally I haven't used them a lot, they look a bit cumbersome.
I have a Date of birth field in my admin form of my django app.
When a user has to select a date he must click back month by month. An old person has to click a lot (If born in 1970 and the calendar starts on 2011 for example).
Is there a way to select year by clicking on it? Or to load a difference calendar widget completely i.e. jquery-calendar? How can I do either of these?
Thanks.
If you're not happy with the default Django form widgets, any of the widgets, your recourse is to create your own or subclass and modify one of the existing. There's tons of posts online about this topic. As always, Google is your friend.
Specifically concerning jQuery Datepicker, I found this gist (updated), which might be helpful to you.