Sorry about that I thought it wont be necessary.
I haven't changed anything I used to get the same trouble when I used
windows edge i.e. the row disappearing, but it wont when I used the google
chrome.
But since last Friday it started with the same issue in chrome.
Here's the relevant codes.
clientset.html :-
{% extends 'base.html' %}
{% block table_name %}Client Account Preference{% endblock %}
{% block table_view %}
ID
Name
Company Name
Accepted Currency
Bank Account Number
Bank Account Type
Company's Linked Bank Account
Actions
ID
Name
Company Name
Accepted Currency
Bank Account Number
Bank Account Type
Company's Linked Bank Account
Actions
{% for datadisplay in Client%}
{{datadisplay.0}}
{{datadisplay.2}}
{{datadisplay.3}}
{{datadisplay.4}}
{{datadisplay.5}}
{{datadisplay.6}}
{{datadisplay.7}}
{% endfor %}
{% endblock %}
{% block add_record_btn %}
{% endblock %}
views.py (code rendering the above html and the one which should execute
on the button click):-
def clientset(request):
cursor.execute(sql_client_set)
result = cursor.fetchall()
return render(request, 'clientset.html', {'Client': result})
def clientsetacc(request, id, id1):
if request.method == 'POST':
acc = request.POST.get('acc')
cursor.execute(
"select
bank_name,bank_acc_name,bank_acc_number,bank_acc_type,bank_address,ifsc_code,swift_code,branch_name
from Company where id =?",
id1)
result = cursor.fetchall()
li = list(result[0])
li1 = []
for i in li:
li1.append(i.split(sep="| "))
li = li1
ind = li[2].index(acc)
result = []
for i in li:
result.append(i[ind])
result.append(id)
sql = '''update Client set cbank_name = ?, cbank_acc_name=?,
cbank_acc_number=?, cbank_acc_type=?,
cbank_address=?, cifsc_code=?, cswift_code=?, cbranch_name=? where
id=?'''
cursor.execute(sql, result)
cursor.commit()
return redirect('/clientset')
else:
cursor.execute('select bank_acc_number from Company where id =
{}'.format(id1))
li = cursor.fetchall()
li = list(li[0])
li = li[0].split(sep='| ')
result = []
for i in li:
result.append(i)
cursor.execute("select name from Client where id = {}".format(id))
name = cursor.fetchall()
return render(request, 'setclientaccount.html', {'accounts':
result, 'client': name})
invoice/urls.py (invoice is django app, urls calling the above function) :-
from django.urls import path, include
from .views import *
urlpatterns = [
path('clientset/',clientset,name='clientset'),
path('clientsetacc///',clientsetacc,name='clientsetacc'),
]
mysite/urls.py :-
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('invoice.urls')),
]
I hope this helps.
All of this was working fine till Tuesday mostly on chrome.
But it has stopped the since Friday.
If I right click the button and open it in a new tab, the 'clientsetacc()'
runs.
But if I left click the button and try to open in the same tab the row in
which the button is disappears. The whole row buttons and everything.
Any suggestion on how to improve the code are also welcome.
Thank You
On Monday, November 1, 2021 at 10:19:35 PM UTC+5:30 Kasper Laudrup wrote:
> On 01/11/2021 13.51, Indrajeet Singh Yadav wrote:
> > So i have a html page rendered which has a tag button. Earlier when
> > i used to click on the button the browser would redirect to the link
> > specified. But now when i am doin the same, the whole row (the button is
> > in a column of a table) disappears and nothing happens. If i right click
> > it then the link opens. What am i doing wrong?
> >
>
&g