R
R
Robot2015-11-12 22:51:47
JavaScript
Robot, 2015-11-12 22:51:47

Two scripts per form, how?

There is a form, by clicking on it, a calendar in JS pops up:

<input type="text" value="dd-mm-yy" onfocus="this.select();lcs(this)"
    onclick="event.cancelBubble=true;this.select();lcs(this)">

I would like to send the date that will be selected using the calendar to be sent to the server via jquey, but the onclick event is already taken by the calendar, I am a noob in JS, how and what should I do in this case?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor, 2015-11-12
@master2016

change

S
SwoDs, 2015-11-12
@SwoDs

You don't need an onClick event, but rather an onChange event Better
yet, rewrite everything in a separate file like this

$('.calendar').on('click', function() {
//code..
})

Do not forget about the class or ID, since you have nothing similar in the input)
info on .on - jquery.page2page.ru/index.php5/On

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question