Forums

I need a reminder to my telephone field.

Ron 15 Jun, 2011
Hello,

I have been using the Version 3.2 I like it better then Version 4.0 or rather it is more user friendly to me. I have an issue which I feel would be easy for you but I don't know how to go about.

I have a contact form in which there is a Telephone field which is not mandatory to fill, so normally everyone that enters details skips it. I want to add a reminder as a pop up window which gives a message that "a service executive can provide you better service if we have your telephone number" and then there are two buttons on the popup window like "YES" "NO", with a question"Do you really not want to provide your telephone number?".

Help please on how I can achieve this..

Thanks
Ron
Ron 23 Jun, 2011
Hello

I was wondering if my post was noticed 🙄

I have a contact form in which there is a Telephone field which is not mandatory to fill, so normally everyone that enters details skips it. I want to add a reminder as a pop up window which gives a message that "a service executive can provide you better service if we have your telephone number" and then there are two buttons on the popup window like "YES" "NO", with a question"Do you really not want to provide your telephone number?".

Help please on how I can achieve this..



If anyone can help I would me most grateful

Thanks

Ron
GreyHead 26 Jun, 2011
Hi Ronn,

Could have sworn I had posted an answer to this a day or so ago :-(

Here's a code snippet to go in the Form JavaScrip box. This assumes that there is an input with id='phone' and the submit button has id='submit'
window.addEvent('domready', function() {
  var answer = true;
  $('submit').addEvent('click', function(event) {
    if ( answer && !$('phone').value ) {
      new Event(event).stop();
      answer = confirm("A service executive can provide you better service if we have your telephone number. \n Would you like to provide your telephone number?");
    }
  });
});

The user has to click submit twice with this, the first time will bring up the question. The second time will Submit the form - provided that they have either (a) clicked 'cancel' ir (b) clicked 'OK' and entered something in the phone input.

Bob
Ron 01 Jul, 2011
Hey Bob,

Thanks for that code. I am grateful. Sadly I am not able to make the form function the id='submit' was not in the form .html so I added it but it does not seem to work.

Is it not possible that when the phone field is empty this pop up shows?

Thanks anyway. You ROCK !🙂

Ron.
GreyHead 01 Jul, 2011
Hi Ron,

Please post a link to the form so I can take a quick look.

Bob
Ron 02 Jul, 2011
Hello Bob

You asked for a link to the form: Please go to
Thanking you

Ron
GreyHead 02 Jul, 2011
Hi Ron,

You have give the id='phone' to both the phone input and the submit input.

This assumes that there is an input with id='phone' and the submit button has id='submit'



Bob
GreyHead 04 Jul, 2011
Hi Ron,

Please read my last post carefully while looking at your Form HTML
<input value="submit" id="phone" name="button_11" type="submit" />
What is the problem with this line?

Bob
Ron 07 Jul, 2011
BOB

Thanks !! Sorry for my mistake it works wonderfully. But is it not possible that when a user chooses "Yes" the cursor reaches the telephone field and when a person presses the "cancel button the form is submitted ?

Thanks for all your support.

Best wishes

Ron
GreyHead 07 Jul, 2011
Hi Ron,

Probably it's possible, not currently on my plans to work out how to do it though :-(

Bob
Ron 10 Jul, 2011
Hi Bob

Thank you very much. That was my mistake. It is working fine. God bless you.

Ron
This topic is locked and no more replies can be posted.