Connecting Tech Pros Worldwide Help | Site Map

Automatic onsubmit?

Andy
Guest
 
Posts: n/a
#1: May 17 '07
<form onsubmit="call_rss();return false;">
<input type="text" name="rssurl" id="rssurl" size="40"
value='Skype'>
</form>

The code above has the value "Skype" and only after hitting Enter/
Return key, the value is submitted. How can the value "Skype" be
submitted automatically without pressing Enter/Return key?

Thanks for the tips, gurus :)

Ujjal
Guest
 
Posts: n/a
#2: May 17 '07

re: Automatic onsubmit?


Randy & Tom, here's actual code:


-----------------------------------------------
<?php
include "rss/rss.php";


function quote ($com) {
$client = new SoapClient("http://services.xmethods.net/soap/
urn:xmethods-delayed-quotes.wsdl");
return $client->getQuote($com);
}

include_once("agent.php");

?>

<?php
$agent->init();
?>







<script>


function call_rss() {
str = document.getElementById('rssurl').value;
agent.call('','rss','callback_rss','http://news.search.yahoo.com/
news/rss?p='+str);
}

function callback_rss(str) {
document.getElementById('div_rss').innerHTML = str;
}




</script><head>
<link href="style.css" rel="stylesheet" type="text/css" />


</head>




<b>AJAX AGENT Demo Portal</b><br/><br/>

<table width="383">
<tr align=left valign=top>
<td width="860">


<table>
<!-- portlet begins -->
<tr align=left valign=top bgcolor=#ddeeff>
<td width="375"><b>RSS Search</b></td>
</tr>
<tr align=left valign=top>
<td colspan=2><br/>
<form onsubmit="call_rss();return false;">
<input type="text" name="rssurl" id="rssurl" size="40"
value='Skype'>
</form<br/>
<div id='div_rss'></div </td>
</tr>
<tr align=left valign=top><td>&nbsp;</td></tr>
<!-- portlet ends -->
</table </td>
</tr>
</table>
<p>&nbsp;</p>



<p>&nbsp;</p>


-----------------------------------------------

As you can see, I want "Skype" to be submitted automatically.


Andy
Guest
 
Posts: n/a
#3: May 17 '07

re: Automatic onsubmit?


Randy & Tom, here's actual code:

-----------------------------------------------
<?php
include "rss/rss.php";

function quote ($com) {
$client = new SoapClient("http://services.xmethods.net/soap/
urn:xmethods-delayed-quotes.wsdl");
return $client->getQuote($com);
}

include_once("agent.php");

?>

<?php
$agent->init();
?>

<script>

function call_rss() {
str = document.getElementById('rssurl').value;
agent.call('','rss','callback_rss','http://news.search.yahoo.com/
news/rss?p='+str);
}

function callback_rss(str) {
document.getElementById('div_rss').innerHTML = str;
}

</script><head>
<link href="style.css" rel="stylesheet" type="text/css" />

</head>

<b>AJAX AGENT Demo Portal</b><br/><br/>

<table width="383">
<tr align=left valign=top>
<td width="860">

<table>
<!-- portlet begins -->
<tr align=left valign=top bgcolor=#ddeeff>
<td width="375"><b>RSS Search</b></td>
</tr>
<tr align=left valign=top>
<td colspan=2><br/>
<form onsubmit="call_rss();return false;">
<input type="text" name="rssurl" id="rssurl" size="40"
value='Skype'>
</form<br/>
<div id='div_rss'></div </td>
</tr>
<tr align=left valign=top><td>&nbsp;</td></tr>
<!-- portlet ends -->
</table </td>
</tr>
</table>
<p>&nbsp;</p>

<p>&nbsp;</p>

-----------------------------------------------

As you can see, I want "Skype" to be submitted automatically.

Closed Thread