473,405 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Simulating a click on an input type submit

3
I have some code and right now it has a submit button. Users select a date and region (state, country, etc.) and when both are selected they press the button and whamo. What I want to do is if they have JavaScript enabled I want to do away with the button and do the submit in the onchange of the combo boxes. Here's the code. Any help?

Response.Write(' ');
Response.Write('<INPUT TYPE="submit" id=submit Name="submit" style="VISIBILITY: hidden" value="'+Session('sSubmitButtonText')+'">');
Response.Write('</FORM>');

function onRegionChange()
{

var Region = String('');
var Index = Number(0);
var AreaIndex = Number(0);
var AreaList;
var RegionList;

AreaList = document.forms['datepicker'].selArea;
RegionList = document.forms['datepicker'].selRegion;
Region = RegionList.options[RegionList.selectedIndex].value;

// Add the All Areas selection under areas
addAreaToAreaList(AreaList, AreaIndex, 'ALL', ' - - All Subregions - - ');
AreaIndex++;

// Add the areas for the selected region
while (Index < sAreaArray.length)
{
if (sRegionArray[Index] == Region)
{
addAreaToAreaList(AreaList, AreaIndex, sAreaIDArray[Index], sAreaArray[Index]);
AreaIndex++;
}
Index = Index + 1;
}

// remove any extra areas from the previously selected region
AreaList.options.length = AreaIndex;

var dfound = Boolean(false);
var dIndex = Number(0);

while ((!dfound) && (dIndex < AreaList.options.length))
{
if (String(AreaList.options[dIndex].value) == "<%=Request.Querystring('selArea')%>")
{
AreaList.options.selectedIndex = dIndex;
dfound = true;
}
dIndex++;
}
if (bJScriptEnabled) {
document.forms['datepicker'].submit.click();
}
Oct 27 '06 #1
0 1268

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: janet | last post by:
hey hi... this in in continuation to my other post. i am trying hard and cannot find out whats the problem. i am getting crazy...please asp experts ...do resolve the problem...its something very...
4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
6
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion...
1
by: balu | last post by:
Hi, I am developing a standalone or windows based application in vb.net which simulates a website. I would like to simulate this web form from my vb.net application: <form action...
5
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has...
9
by: Prakash Singh Bhakuni | last post by:
am replacing the default "Browse..." button for input type=file. This works fine except that the form will only submit after the SUBMIT button is clicked twice. Any ideas on why this is happening...
11
by: yangsuli | last post by:
i want to creat a link when somebody click the link the php script calls a function,then display itself :) i have tried <a href=<? funtion(); echo=$_server ?>text</a> but it will call the...
3
by: Wojtek | last post by:
Given the following somewhat abbreviated code: ------------------------------------------ <table> <form name="aForm1" action="doStuff" method="post"> <input type="hidden" name="id" value="1">...
3
by: ghjk | last post by:
I have a web page which is used to enter user data. In there I have 4 buttons named as "Submit, Confirm,Edit,Cancel". User should enter data and click "Submit " button. Then I want to display all...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.