Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
let say i have 2 textbox which is e-mail and H/P.

if the e-mail textbox appear hotmail this word,it will prompt 1 message box once i onclick to H/P textbox.

<label for="emel">E-mail:</label>
<input type="text" id="emel" name="emel" value="<?php echo $emel;?>" />

<label for="username">Phone Number:</label>
<input type="text" id="pNumber" name="pNumber" value="<?php echo $pNumber; ?>" />


how could i write the code? can anyone help me?

regards.
thanks in advance
Posted

1 solution

You can include jquery and then:

JavaScript
<script type="text/javascript">

$(function(){

  $('#pNumber').click(function(){
    if($('#emel').val().indexOf('hotmail') !== false){
      alert('This is the message prompt!');
    }
  });

});

</script>
 
Share this answer
 
Comments
Adrian4263 3-Feb-14 23:13pm    
Thanks for your answer, but the code u giving can't work as well.
Killzone DeathMan 6-Feb-14 12:17pm    
Why? Whats wrong? :P
add my skype, its better to talk

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900