All pastes #142145 Raw Edit

Mine

public text v1 · immutable
#142145 ·published 2006-08-21 09:06 UTC
rendered paste body
<head><title>Add new list</title></head>
<body>
<form name='form' onsubmit='javascript:return addList()'>
<table align='center'>
<tr>
<td>List Type:</td>
<td>PhoneNumber</td>
</tr>
<tr>
<td>New&nbsp;list&nbsp;name:</td>
<td><input name='list' style='width:7em' maxlength='15'></td>
</tr>
<tr>
<td><input type='button' value='Ok' style='width:7em' onclick='javascript:addList()'></td>
<td><input type='button' value='Cancel' style='width:7em' onclick='javascript:window.close()'></td>
</tr>
</table>
</form>
<script>                  
var submitted = false;
function addList() {
  if (submitted) {
      alert('Please don\'t submit again.');
      return false;      
  }
  var list=window.document.form.list.value;
  var re = /^[a-zA-Z_]\w{4,14}$/;
  if (re.test(list) == false) {
    alert('The list name must be between 5 and 15 characters\nand contain only letters, numbers or underscores. \nThe first character must be letter or underscore.');
    return false;     
  }                                                                      
  submitted = true;
  window.close();
  opener.addListReturn('PhoneNumber', list); 
  return true;
}
</script>
</body>