I am using a javascript form with a server-side processor and I want to be able to have the form go to different emails based on the dropdown. I've gotten as far as I could based on other forms but I can't seem to get the emails to go through. I have added under the option tag on the email addresses for the choices and changed the value from an overall form email to "mailTo" () I am pretty sure this is where the issue is but I don't know how to fix it.
<form action="http://www.testsite.com/cgi-sys/formmail.pl" method="post" name="hgmailer">
<input type="hidden" name="recipient" value="mailTo">
<input type="hidden" name="subject" value="Website Consult Request">
<table width="100%" border="0" cellspacing="10px" cellpadding="10px">
<tbody>
<tr>
<td>Nearest Location*</td>
<td><select id="mailTo" name"mailTo">
<option value="option1#testsite.com">Option1</option>
<option value="option2#testsite.com">Option2</option>
<option value="option3#testsite.com">Option3</option>
<option value="option4#testsite.com">Option 4</option>
</select></td>
</tr>
</tbody>
</table><p> </p>
<input type="button" value="Schedule a Consultation" onclick="hgsubmit();" class="button">
<input type="hidden" name="redirect" value="thankyou.html">
</form>
EDIT - My final code did not save previously
What you can do is add a javascript function to change the value of "recipient" to the selected email like...
function changeVal() {
var selectedVal = document.getElementById("mailTo").value;
document.getElementById("recipient").value = selectedVal;
var test = document.getElementById("recipient").value;
//alert(test);
}
<form action="http://www.testsite.com/cgi-sys/formmail.pl" method="post" name="hgmailer">
<input type="hidden" name="recipient" id="recipient" value="mailTo">
<input type="hidden" name="subject" value="Website Consult Request">
<table width="100%" border="0" cellspacing="10px" cellpadding="10px">
<tbody>
<tr>
<td>Nearest Location*</td>
<td><select id="mailTo" name"mailTo" onchange="changeVal()">
<option value="option1#testsite.com">Option1</option>
<option value="option2#testsite.com">Option2</option>
<option value="option3#testsite.com">Option3</option>
<option value="option4#testsite.com">Option 4</option>
</select></td>
</tr>
</tbody>
</table><p> </p>
<input type="button" value="Schedule a Consultation" onclick="hgsubmit();" class="button">
<input type="hidden" name="redirect" value="thankyou.html">
</form>
...I added an alert that you can comment out if you would like to test. Also I did this in javascript and not Jquery as you only asked for that.
Related
I am a n00b to jquery and web development and I am trying to create a series of dropdown menus that upon the user selecting an option will then make the next dropdwon menu appear, with a table appearing last.
Here is the HTML:
<div class="dropdownMenus">
<form id="menu1">
<h2>Choose your number</h2>
<select>
<option class="descriptive" value="descriptive">Please choose your area</option>
<option class="menuoption1" value="01493">01493 - Great Yarmouth</option>
<option class="menuoption1" value="01603">01603 - Norwich</option>
<option class="menuoption1" value="01393">01393 - Kings Lynn</option>
<option class="menuoption1" value="01763">01763 - Lowestoft</option>
</select>
</form>
</div>
<div class="dropdownMenus">
<form id="menu2">
<h2>Number Type</h2>
<select>
<option class="descriptive" value="descriptive">Please choose your number</option>
<option class="menuoption2" value="gold">Gold</option>
<option class="menuoption2" value="silver">Silver</option>
<option class="menuoption2" value="bronze">Bronze</option>
</select>
</form>
</div>
<div class="dropdownMenus">
<form id="menu3">
<h2>Order</h2>
<form>
<input id="menuoption3" type="checkbox" value="sequential"> Sequential<br>
<input id="menuoption4" type="checkbox" value="random"> Random<br>
<input id="menuoption5" type="checkbox" value="voice"> Voice<br>
<input id="menuoption6" type="checkbox" value="email"> Email<br>
</form>
</form>
</div>
<table id="resultsTable">
<thead>
<tr>
<th>Area</th>
<th>Number Type</th>
<th>Select</th>
<th>Voice</th>
<th>Mail</th>
</tr>
</thead>
<tbody>
<tr>
<td>Placeholder Data</td>
<td>Placeholder Data</td>
<td>
<input type="checkbox" id="select" />
</td>
<td>
<input type="checkbox" id="voice" />
</td>
<td>
<input type="checkbox" id="mail" />
</td>
</tr>
</tbody>
</table>
And here is my jQuery:
$(document).ready(function(){
var $packages = $("#menu2");
var $orders = $("#menu3");
var $resultsTable = $("#resultsTable");
$packages.hide();
$orders.hide();
$resultsTable.hide();
$(".menuoption1").click(function(){
$packages.show();
});
$(".menuoption2").click(function(){
$orders.show();
});
$("#menuoption3, #menuoption4, #menuoption5").click(function(){
$resultsTable.show();
});
});
Here is a link to what I have done so far:
https://jsfiddle.net/monkeyroboninja/9f9sotfv/
If you look at the link in Firefox or IE it works as it should, but viewed through Chrome it does not work completely. The initial hiding of the elements works but the reveal upon the click() events firing does not. Any help would be much appreciated :-)
Instead of
$(".menuoption1").click(function(){...
Try
$("#menu1").change(function(){...
This should work in all browsers and fires when the value of the dropdown is changed.
The reason why .click doesnt work(thanks to #Archer):
It's because option elements have no click event.
A change event handler on the select element would have worked too.
I am working on this form with several select elements with options Yes, No or Not applicable. It was required that whenever the user select yes option a separate date field appears next to it. I used HTML DOM document.getElementById("id").innerHTML for this date field. Everything went well but I was not able to pass the value of date to the form action page using POST method. Check this code:
<!-- javascript code -->
<script type="text/javascript">
function credit_check(name){
if(name=='YES')document.getElementById('div2').innerHTML='Date: <input type="date" name="credit_check_date" value= "mm/dd/yyyy" />';
else document.getElementById('div2').innerHTML='';
}
function employment_check(name){
if(name=='YES')document.getElementById('div3').innerHTML='Date: <input type="date" name="employment_check_date" value= "mm/dd/yyyy" />';
else document.getElementById('div3').innerHTML='';
}
</script>
</head>
<body>
<?php include("menu.inc"); ?>
<div id="main">
<table>
<form method="post" action="checkinfo.php">
<tr><td colspan=2><hr/><input type="hidden" name="consultant_id" value="<?php echo $consult_id; ?>"> </td>
</tr>
<tr align="center">
<td><b>Credit Check </b></td>
<td>
<select name="2" onchange="credit_check(this.options[this.selectedIndex].value)">
<option selected="selected">Please select ...</option>
<option value="YES">Yes</option>
<option value="NO">No</option>
<option value="NA">Not Applicable</option>
</select>
</td>
<td> <div id ="div2"> </div></td>
</tr>
<tr align="center">
<td><b>Employment Check :<font color='red'>*</font></b></td>
<td>
<select name="3" onchange="employment_check(this.options[this.selectedIndex].value)">
<option selected="selected">Please select ...</option>
<option value="YES">Yes</option>
<option value="NO">No</option>
<option value="NA">Not Applicable</option>
</select>
</td>
<td> <div id ="div3"> </div></td>
</tr>
</form>
</table>
Demo - Change function credit_check(name) to window.credit_check = function(name)
window.credit_check = function(name){
if(name=='YES') document.getElementById('div2').innerHTML='Date: <input type="date" name="credit_check_date" value= "mm/dd/yyyy" />';
else document.getElementById('div2').innerHTML='';
}
window.employment_check = function (name){
if(name=='YES') document.getElementById('div3').innerHTML='Date: <input type="date" name="employment_check_date" value= "mm/dd/yyyy" />';
else document.getElementById('div3').innerHTML='';
}
You're script wasn't loading properly,
Uncaught ReferenceError: credit_check is not defined in your console shows the error. The functions were not being defined. You can set your functions like above or reposition your code.
Put the inputs into the HTML at loading, then simply hide/show them.
<!-- javascript code -->
<script type="text/javascript">
function credit_check(name){
if(name=='YES')document.getElementById('div2').style.display = 'block';
else document.getElementById('div2').style.display = 'none';
}
function employment_check(name){
if(name=='YES')document.getElementById('div3').style.display = 'block';
else document.getElementById('div3').style.display = 'none';
}
</script>
</head>
<body>
<?php include("menu.inc"); ?>
<div id="main">
<table>
<form method="post" action="checkinfo.php">
<tr><td colspan=2><hr/><input type="hidden" name="consultant_id" value="<?php echo $consult_id; ?>"> </td>
</tr>
<tr align="center">
<td><b>Credit Check </b></td>
<td>
<select name="2" onchange="credit_check(this.options[this.selectedIndex].value)">
<option selected="selected">Please select ...</option>
<option value="YES">Yes</option>
<option value="NO">No</option>
<option value="NA">Not Applicable</option>
</select>
</td>
<td> <div id ="div2" style="display: none;">
Date: <input type="date" name="credit_check_date" value= "mm/dd/yyyy" />
</div></td>
</tr>
<tr align="center">
<td><b>Employment Check :<font color='red'>*</font></b></td>
<td>
<select name="3" onchange="employment_check(this.options[this.selectedIndex].value)">
<option selected="selected">Please select ...</option>
<option value="YES">Yes</option>
<option value="NO">No</option>
<option value="NA">Not Applicable</option>
</select>
</td>
<td> <div id ="div3" style="display: none;">
Date: <input type="date" name="employment_check_date" value= "mm/dd/yyyy" />
</div></td>
</tr>
</form>
</table>
It's also a good idea to check out jQuery, it makes this kind of stuff a lot easier to do.
Your code is already working. See http://jsfiddle.net/2wg4u6ut/
Make sure your JavaScript is in the head section of your document.
There were some minor issues in your formatting where the <form> tag belongs around the table.
You also were missing the submit button, but then it's already working.
I found this script to add rows to my form somewhere and I can add rows that works, the only problem is that when I submit it, only the first row are submitted. Never tried anything like this before so I might be completely off and if that is the case at least I will know that.
THIS IS THE HTML
<form name="addshow" action="addshow.php" method="post">
<input type="submit" value="Lägg till">
<input type="reset" value="Nollställ"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#add").click(function() {
$('#tableclassen tbody>tr:last').clone(true).insertAfter('#tableclassen tbody>tr:last');
return false;
});
});
</script>
<a id="add">+</a>
<TABLE id='tableclassen' cellpadding="3" cellspacing="0">
<TBODY>
<TR valign="top">
<TD width>
<input type="text" placeholder="ID" name="Horse_id" required oninvalid="this.setCustomValidity('Ange ID')" oninput="setCustomValidity('')" size="5"/>
</TD>
<TD>
<input type="text" placeholder="Årtal" name="years" required oninvalid="this.setCustomValidity('Ange årtal')" oninput="setCustomValidity('')" size="6"/>
</TD>
<TD>
<input type="text" placeholder="Plac." name="place" required oninvalid="this.setCustomValidity('Ange placering')" oninput="setCustomValidity('')" size="4"/>
</TD>
<TD>
<input type="text" placeholder="Ange eventnamn" name="event" required oninvalid="this.setCustomValidity('Ange eventnamn')" oninput="setCustomValidity('')" size="35"/>
</TD>
<TD>
<input type="text" placeholder="Ange klass" name="class" required oninvalid="this.setCustomValidity('Ange klass')" oninput="setCustomValidity('')" />
</TD>
<TD>
<input type="text" placeholder="Assoc." name="association" required oninvalid="this.setCustomValidity('Ange Assoc.')" oninput="setCustomValidity('')" size="6"/>
</TD>
<TD>
<input type="text" placeholder="Poäng" name="points" required oninvalid="this.setCustomValidity('Ange poänh')" oninput="setCustomValidity('')" size="3"/>
</TD>
<TD>
<select name="type" required oninvalid="this.setCustomValidity('Välj typ')" oninput="setCustomValidity('')">
<option value="" disabled selected>Välj typ</option>
<option value="SWE">SWE</option>
<option value="INTER">INTER</option>
</select>
</TD>
<TD>
<select name="dis">
<option value="" disabled selected>Välj Dis</option>
<option value="D">D</option>
<option value="SJ">SJ</option>
<option value="E">E</option>
<option value="U">U</option>
<option value="K">K</option>
<option value="T">T</option>
</select>
</TD>
</TR>
</TBODY>
</TABLE>
</form>
THIS IS THE PHP/DATABASE PROCESS
<?php
session_start();
ob_start();
include("function/conn.php"); //Databas koppling
mysql_set_charset("utf8");
$Horse_id = addslashes($_POST['Horse_id']);
$Year = addslashes($_POST['years']);
$Place = addslashes($_POST['place']);
$Event = addslashes($_POST['event']);
$Class = addslashes($_POST['class']);
$Assoc = addslashes($_POST['association']);
$Point = addslashes($_POST['points']);
$Type = addslashes($_POST['type']);
$Dis = addslashes($_POST['dis']);
//Sparar värden i variabler ifrån form
$result = mysql_query(" INSERT INTO shows
(Horse_id, years, place, event, class, association, points, type, dis)
VALUES('$Horse_id', '$Year', '$Place', '$Event', '$Class', '$Assoc', '$Point', '$Type', '$Dis') ") or die(mysql_error());
// Lägger in ny post i databasen
if ($result){ //Skicka tillbacka användaren till backend
header("location: admin.php");
}
else{
echo "Something went wrong.";
}
?>
Give the form fields array-style names, e.g.
<input type="text" placeholder="ID" name="Horse_id[]" required oninvalid="this.setCustomValidity('Ange ID')" oninput="setCustomValidity('')" size="5"/>
Then in PHP, $_POST['Horse_id'] will be an array of all the inputs; the server script can loop through them and insert them all in the DB. If you use the same name in all rows without [], $_POST['Horse_id'] will only contain the last one.
The problem is because you don't change the name'ed field of the cloned inputs and the back-end only takes the last one in most cases.
I left an example in a similar topic: Change name attribute of input/select field nested in a cloned table for dynamic form entry - Javascript
I have created a script for partial season ticket package sales on my music group's website. A user would select 4 concert programs and then select a date for each concert program selected. All of these selections need to post to Paypal for processing/purchasing. My "Add to Cart" button does route to Paypal, but the concert programs and dates are not being picked up. The box office people need this information. You can see the code I have here: http://jsfiddle.net/saraswati/v6Pur/66/
Here is the HTML:
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"><strong><a name="Partial">Partial</a> subscription (4 concerts), Regular Price: $87.00 (a savings of 13%)</strong>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="business" value="temp_1344946752_biz#me.com">
<input type="hidden" name="item_name" value="Partial subscription (4 concerts), Regular Price">
<input type="hidden" name="amount" value="87.00">
<input type="hidden" name="currency_code" value="USD">
<table width="90%" cellspacing="0" cellpadding="0" border="1">
<CAPTION>Please select the desired concert program and then the desired date from the pull-down menus. Then click the "Add to Cart" button.</CAPTION>
<tr id="row1" align=center>
<td><font color="#990000">Concert 1:</font></td>
<td><font color="#990000">Concert 2:</font></td>
<td><font color="#990000">Concert 3:</font></td>
<td><font color="#990000">Concert 4:</font></td>
</tr>
<tr id=row2>
<td><input type="hidden" name="os0" value="Concert 1"><body onload="ChangeDateDropList ();">
<select id="program1" onchange="ChangeDateDropList(1);">
<option value="" selected="selected">Select a Program</option>
<option value="TUDORS">The Tudors</option>
<option value="NOCHES">Noches, Noches</option>
<option value="CHRISTMAS">Christmas Eurotour</option>
<option value="CELTIC">Celtic Trinity</option>
<option value="UNREQUITED">Unrequited Love</option>
<option value="SECRET">Secret No More</option>
</select>
<select id="date1">
</select>
</body>
</td>
<td><input type="hidden" name="os1" value="Concert 2"><body onload="ChangeDateDropList ();">
<select id="program2" onchange="ChangeDateDropList(2);">
<option value="" selected="selected">Select a Program</option>
<option value="TUDORS">The Tudors</option>
<option value="NOCHES">Noches, Noches</option>
<option value="CHRISTMAS">Christmas Eurotour</option>
<option value="CELTIC">Celtic Trinity</option>
<option value="UNREQUITED">Unrequited Love</option>
<option value="SECRET">Secret No More</option>
</select>
<select id="date2">
</select>
</body>
</td>
<td><input type="hidden" name="os2" value="Concert 3"><body onload="ChangeDateDropList ();">
<select id="program3" onchange="ChangeDateDropList(3);">
<option value="" selected="selected">Select a Program</option>
<option value="TUDORS">The Tudors</option>
<option value="NOCHES">Noches, Noches</option>
<option value="CHRISTMAS">Christmas Eurotour</option>
<option value="CELTIC">Celtic Trinity</option>
<option value="UNREQUITED">Unrequited Love</option>
<option value="SECRET">Secret No More</option>
</select>
<select id="date3">
</select>
</body>
</td>
<td><input type="hidden" name="os3" value="Concert 4"><body onload="ChangeDateDropList ();">
<select id="program4" onchange="ChangeDateDropList(4);">
<option value="" selected="selected">Select a Program</option>
<option value="TUDORS">The Tudors</option>
<option value="NOCHES">Noches, Noches</option>
<option value="CHRISTMAS">Christmas Eurotour</option>
<option value="CELTIC">Celtic Trinity</option>
<option value="UNREQUITED">Unrequited Love</option>
<option value="SECRET">Secret No More</option>
</select>
<select id="date4">
</select>
</body>
</td>
</tr>
</table>
<br>
<center>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</center>
And here is the Javascript:
var progamsAndDates = {};
progamsAndDates.TUDORS = ['Sept. 15', 'Sept. 16'];
progamsAndDates.NOCHES = ['Oct. 20', 'Oct. 21'];
progamsAndDates.CHRISTMAS = ['Dec. 14', 'Dec. 15', 'Dec. 16'];
progamsAndDates.CELTIC = ['Jan. 26', 'Jan. 27'];
progamsAndDates.UNREQUITED = ['Mar. 02', 'Mar. 03'];
progamsAndDates.SECRET = ['Apr. 20', 'Apr. 21'];
function ChangeDateDropList (id) {
var programDropList = document.getElementById ("program"+id);
var dateDropList = document.getElementById ("date"+id);
var selProgram = programDropList.options[programDropList.selectedIndex].value;
// remove all dates
while (dateDropList.options.length) {
dateDropList.remove (0);
}
// add new dates
var dates = progamsAndDates[selProgram];
if (dates) {
for (var i=0; i < dates.length; i++) {
var date = new Option (dates[i], i);
dateDropList.options.add (date);
}
}
}
Again, when I click on the "Add to Cart" button, it goes to Paypal and the description reads "Partial subscription (4 concerts), Regular Price" and it picks up the Item Price, etc. However, the description should also show the selections, such as "Tudors, Sept. 15; Celtic, Jan.27; etc." I query the wisdom of you all in getting this to work. Thank you!
The variables you are passing over are not correct. You are passing over variables such as on0, os0, on1, os1. These would be correct for add to cart buttons or buy now buttons, but since you are using the cart upload method they need to be passed over like on0_1, os0_1, on1_2, and os1_2. This will correct your issue, and they should then show up.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="my_email#my_site.com">
<input type="hidden" name="item_name_1" value="Football T-Shirt">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="on0_1" value="Color">
<input type="hidden" name="os0_1" value="Red">
<input type="hidden" name="on1_1" value="Size">
<input type="hidden" name="os1_1" value="Small">
<input type="hidden" name="item_name_2" value="Notebook">
<input type="hidden" name="amount_2" value="2.00">
<input type="hidden" name="on0_2" value="Number of Pages">
<input type="hidden" name="os0_2" value="200">
<input type="hidden" name="on1_2" value="Type">
<input type="hidden" name="os1_2" value="3 Ring">
<input type="submit" value="PayPal">
</form>
I have a filtering option in my Django application. The filtering is done by the choice (Name, location, designation EmployeeID, ..etc) selected on a drop down and the value entered in a text field. Now I wanted to validate when the user chooses EmployeeID from the drop down choice. If no value is entered in text box while selecting EmployeeID, then the form should not be submitted, and alert should be shown to enter some text. I created a js function for checking the field is empty or not, but its not working the way I wanted. I will paste my code here.
<form name="myform" id="myformid" method="POST" >
Filter By:
<select name="choices" id ="choicesId" style="color: black; background-color: #BDBDBD" >
<option value="Name">Name</option>
<option value="Designation" >Designation</option>
<option value="EmployeeID" id="empid">EmployeeID</option>
<option value="Project" >Project</option>
<option value="DateOfJoin" >Date Of Join</option>
<option value="location" >Location</option>
<option value="email">Email</option>
<option value="skills">Skills</option>
</select>
<input id="textField "type="text" name="textField" style="color: black; background-color: #BDBDBD" >
<input type="button" value="Go" onclick="isEmpty();">
</form>
<table id="employeeTable" class="tablesorter">
<thead><tr><th>Employee List <!-- <input type="image" src="/static/sort_asc.gif " height="12" name="sortAscend"> --> </th></tr></thead> <br>
<tbody>
{%for emp in emp_list.object_list%}
<tr>
<td><a STYLE="text-decoration:none" href ="http://10.1.0.90:8080/singleEmployee/{{emp.id}} "> {{ emp.userName }} </a></td>
</tr>
{%endfor%}
</tbody>
</table></h4>
</div><br><br>
<a STYLE="text-decoration:none" href="http://10.1.0.90:8080/createEmployee/ ">Create New Employee </a>
<script type="text/javascript">
function isEmpty(){
if ((document.myform.choices.selectedIndex.value==''))
{
alert(document.myform.choices.options[document.myform.choices.selectedIndex].id);
alert("Hi");
document.myform.choices.focus();
/*document.getElementById('employeeIDfield').innerHTML = 'Please fill this field';*/
return true;
}
else
{
alert("Data entered");
document.getElementById('myformid').action = "http://10.1.0.90:8080/filter/";
document.getElementById('myformid').submit();
return false;
}
}
</script>
What I could understand is the form is still getting submitted even after entering the Javascript function. The else condition is working for all process. Can somebody look into this problem and give me a solution? Please put a comment for any more clarity I should give. Any help would be appreciated.
Checked your code and if I understand your problem correctly, you want do that:
<form name="myform" id="myformid" method="POST" action="http://10.1.0.90:8080/filter/" onSubmit="javascript:return isEmpty();" >
Filter By:
<select name="choices" id ="choicesId" style="color: black; background-color: #BDBDBD" >
<option value="Name">Name</option>
<option value="Designation" >Designation</option>
<option value="EmployeeID" id="empid">EmployeeID</option>
<option value="Project" >Project</option>
<option value="DateOfJoin" >Date Of Join</option>
<option value="location" >Location</option>
<option value="email">Email</option>
<option value="skills">Skills</option>
</select>
<input id="textField" type="text" name="textField" style="color: black; background-color: #BDBDBD" value="" / >
<input type="submit" value="Go"/>
</form>
<table id="employeeTable" class="tablesorter">
<thead><tr><th>Employee List <!-- <input type="image" src="/static/sort_asc.gif " height="12" name="sortAscend"> --> </th></tr></thead> <br>
<tbody>
{%for emp in emp_list.object_list%}
<tr>
<td><a STYLE="text-decoration:none" href ="http://10.1.0.90:8080/singleEmployee/{{emp.id}} "> {{ emp.userName }} </a></td>
</tr>
{%endfor%}
</tbody>
</table></h4>
</div><br><br>
<a STYLE="text-decoration:none" href="http://10.1.0.90:8080/createEmployee/ ">Create New Employee </a>
<script type="text/javascript">
function isEmpty(){
var my_select = document.myform.choices;
var selected_index = my_select.selectedIndex;
var my_textfield = document.getElementById('textField');
if ((my_select[selected_index].value == 'EmployeeID') && ((my_textfield.value=='') || (my_textfield.value==null))) {
alert("Enter employee ID!");
my_textfield.focus();
return false;
}
else{
alert("Data entered");
return true;
}
}
</script>