Jump to content

getElementById (Again)


anujgarg

Recommended Posts

Hi

 

I am repeting my question/problem in somewhat more descriptive way:

 

I have two forms having same functionality of searching with single textbox only. Both forms are using same JS functions for validation. So my problem is if I fill any of the textbox then another form creates problem (occurs validation). Also, in the second form, I have another field of dropdown which is totally dependent on form's action.

 

If I use the following code for both the forms then I face the above problem:

 

<form method="post" id="locator_full_form" action="/postdata.php" onsubmit=" fn_val_postal(document.forms[0].elements('typed_zip_field'));">

<div>
<input type="hidden" name="form_id_hidden_field" value="locator_full_form" />
</div>

<p>
Enter your 5-Digit U.S. ZIP code or the first 3 characters of your Canadian postal code:
</p>

<p>
<input id="id_input_typed_zip" type="text" name="typed_zip_field" />

<input type="image" src="/images/btn_submit.jpg" name="zip_button" value="Search by Zipcode" />
<br />
</form>

 

How can I make both the forms functioning at the same time??

 

Any help will be highly appreciated.

 

TIA

Link to comment
https://forums.phpfreaks.com/topic/157607-getelementbyid-again/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.