SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: alert problem

  1. #1
    SitePoint Member
    Join Date
    Jul 2003
    Location
    germany
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    alert problem

    hi,

    i got problem rgarding alert i created a select time field

    <td nowrap align="center">
    <select name="time" >
    <option value="8:0">8:0</option>
    <option value="9:0">9:0</option>
    <option value="10:0">10:0</option>
    <option value="11:0">11:0</option>
    </select>
    <input type="button" name="systime" size="1" value=">" onclick="insertTime();">// when clciking on this button it wil show system time
    </td>
    <td nowrap align="center">
    <input type="button" value="Save " name="Save" border="1" onclick="go();">
    </td>

    when i clicks on save button it show alert that atleast slect time
    the function
    function go(){
    var myindex=document.forms["tstest"].bis.selectedIndex;
    if (myindex==0) {
    alert("\nPlease be sure that time menu is selected.");
    return false;
    document.forms["test"].bis.focus();
    }
    document.test.submit();
    }//submit go()

    but the problem is when i clcik on this button it show the system time and i jsut want to avoid this alert,i mean i dont want this alert when button 'systime' is clicked so how to avoid this complexity on the other hand i also dont want user to clcik save button without selecting time

    thanks in advance

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Maryland, USA
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What does the insertTime() function look like?

    By default, the time for the selection box is 8:00. So there will always be a time selected when the user click 'Save'.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •