Forum Moderators: open

Message Too Old, No Replies

Help with a submit button on form

         

Joek

9:07 pm on Oct 7, 2009 (gmt 0)

10+ Year Member



Hello all. I must first introduce my self as extreme novice and I wondering if someone can help me. I have a login script that I'm modifying a bit, and would like the format to match the rest of my page. The problem that I'm having is that I can not create a submit button, but rather it references some javascript and ajax. I was wondering if there was a way just to submit to get this to work. The form looks like this:

<form action="" method="" name="form_passwprocess" id="form_passwprocess">

<input class="inplaceError" type="text" id="email" name="email" maxlength="120" value=""/>
<input type="hidden" name="forgetpasswordaction" value="1"/>
<div style="clear:both;"></div>
<div id="email_error" class="error"></div>
<a id="_forgetpassw_btt" class="button">Send</a>
</form>

...and I believe it's referencing this part of a javascript file:

var PasswProcess = {

init: function () {
},

initEventHandlers : function(){
if($('#_forgetpassw_btt')){
$("#_forgetpassw_btt").click(function(e){
PasswProcess.processPasswordSubmit();
});
}
if($('#_resetpassw_btt')){
$("#_resetpassw_btt").click(function(e){
PasswProcess.processResetSubmit();
});
}
$('.inplaceError').each(
function(i) {
var $this = $(this)
$this.focus(function(e){
$("#"+ $this.attr('id') +"_error").html('');
});
}
);
},
processPasswordSubmit : function(event){
$('#_forgetpassw_btt').hide();
$('#ajaxld').show();
setTimeout("PasswProcess.formPasswsubmit()",500);
},
formPasswsubmit : function(){
var url = 'php/corecontroller.php?ts='+new Date().getTime();
_obj = this;
$.post(url, $('#form_passwprocess').serialize(), PasswProcess.onsubmitpasswcomplete,"json");
},
onsubmitpasswcomplete : function(data,textStatus){
if(textStatus == "success"){
if(data.result == "1"){
//register sucessful
$('#ajaxld').hide();
var htmlstr = "";
htmlstr += "<p>Soon you will receive an email at "+$('#email').val()+" with a link to reset your password!</p>";
$('#pagecontent').html(htmlstr);
}
else if(data.result == "-1"){
for(var i=0; i < data.errors.length; i++ ){
if(data.errors[i].value!="")
$("#"+data.errors[i].name+'_error').html("<div class='errorimg'>"+data.errors[i].value+"</div>");
}
$('#ajaxld').hide();
$('#_forgetpassw_btt').show();
}

I was just wondering if there is an easy way just to show the standard submit button rather than it referencing the ajaxld? I hope this makes sense as I'm very new to all of this.

Joe

whoisgregg

9:43 pm on Oct 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, Joek!

What happens if you simply add a submit button after the text input?

<input class="inplaceError" type="text" id="email" name="email" maxlength="120" value=""/> 
<input type="submit" value="Submit" />